Hi Hamid
I tend to find that apache ab.exe may sometimes give false failures, so try to use another load testing utility if you can.
Your point about quizzes is a recurring one. If you enable your mysql general.log file, you'll see how many database queries are being done when a page is accessed. Just as a test, a one question multiple-choice generates 144 queries from start to finish. Interestingly, the same quiz done in HotPotatoes generates 61 queries - so this could be something worth investigating if you want to reduce db load. The level of SELECT queries remains the same at roughly 70% for both types.
Taking a look at your mysql data, the effectiveness and stability of the Query Cache is good with a utilisation of 59% and no prunes. However, here are a few changes that might help:
- Change key_buffer_size to 8M (to improve key buffer utilisation)
- Change query_cache_min_res_unit to 2M (to reduce the high QCache fragmentation ratio)
- Change table_cache to 512
- Change thread_cache_size to 600 (to reduce possible thread thrashing)
Another area to look at is your httpd.conf. General apache performance tuning suggests to remove as many modules as you can get away with, so as to reduce the footprint of the httpd process. The lowest I've ever been able to reduce the modules used on Windows is to rem out all the Load_modules statements except:
- mod_authz_default, mod_authz_groupfile, mod_authz_host
- mod_dir
- mod_log_config
- mod_mime
So, all the others are remmed-out with a hash (except the php module ). Also, remember to set ThreadsPerChild to 1000 if you anticipate 1k users. Another tip to reduce processor cycles is to turn off compression (either in php.ini - zlib.output.compression = Off - or in apache).
I think that the extra RAM and processor will definitely help out - make sure to turn on hyperthreading in the BIOS as this will give you 4 virtual processors .
As for knowing if the system will hold up, I've attached a JMeter file which might be useful. It will simulate users logging in and browsing to the moodle home page of your site. Use it as follows:
- Click on the Moodle Home Page icon and set the server name or ip address of your server.
- Click on the Login icon and set the server name /ip as well as the username and password to login as.
- Click on the HTTP Thread Group icon and set the Number of Threads (users) to the number of users to simulate.
- Click on Run -> Start and switch to the Summary report to see what's happening.
- A successful simulation shows zero Error %.
Keep increasing the number of users until you start getting errors - you'll then know the absolute maximum your system can cope with - but note that this is dependent on the number of threads your own PC can create, so if you want to simulate over 200 users it's best to run it on 2/3 PCs at the same time.
In the end, you can only do the best with what you have, after which the next step is load balancing and splitting the database and apache onto different servers - for which a Moodle Partner will probably be ideal!
Let us know how things go.
Ken