I didn't know where to post it so I hope this is a good spot. For a client we had to made a quiz show which will be runned 15000 times / hour max. One quiz consists of 30 questions some setup pages (enter name etc) and a result page with a total.

For testing we used two webservers and one database server. At first we reached 1900 quizzes / hour for each webserver. After searching it came clear we were doing a lock on a table and we were using InnoDB. After we changed this to MyISAM we reached 4000 quizzes/hour for each webserver. This still wasn't enought to handle the 15000 quizzes / hour. After analyzing we saw that for completing one full exam 20 MB of data was send to the webserver. This is 15000*20= 300000 MB / hour (293 GB). Afther the queries were analyzed it came clear that the ones causing so many data were:

SELECT data, created, headers, expire FROM cache WHERE cid = 'locale:nl'
168164 bytes

SELECT data, created, headers, expire FROM cache_menu WHERE cid = '0:nl'
72588 bytes

This was done every page load. This means that every page load this data was send from the database server to the webserver. To limit this data transfer and the load we installed the apc module. This increased the amount of quizzes per hour to 6000 / webserver. Static pages like the frontpage are even displayed extremely fast because cache_page's are also served from webserver's memory. The data send from the database server to the webserver for one quiz is now 2.6 MB.

The webserver's currently have 1 processor. The webhosting company will add one CPU in each webserver so it will be able to server 15000 / quizzes / hour with two webservers and one database server.

Thanks!

Comments

R.Muilwijk’s picture

BTW: The lock on table was fixed in a later stadium too.

R.Muilwijk’s picture

Status: Active » Closed (fixed)