Following the XML Model
Sunday, April 29th, 2007Last week, I tested one of the parts of my pet project. To be more precise, it was a stress test. The result wasn’t so bad. Through this test, I found out which parts can make the server bog down.
The application is simple. It’s a page that shows useful information to an inbound call center agent and a menu for call dispositions. It shows session data and statistics, queue information, call details and a list of call dispositions that they can choose. In short, it’s a helper screen with a touch of CRM.
The test was done on about 150 seats (I think). I think at production’s peak hours, it makes 26 queries per user every 5 seconds (8 of those are unchangeable because of authentication). So that should be about 780 querries per second. Those queries are called via AJAX.
Although that didn’t cause the server to crash, it reached the maximum number of users logged in at the database (using persistent connections).
To rectify it, I can increase that limit. But only losers do that. I’ll try some form of caching. I don’t know why I didn’t think of it before. My plan is to execute the 2 queries that are repeated every X seconds (call and queue data) and cache the results. That should reduce the load on the database. The session data can be event triggered, reducing it even further.
The cache will contain three directories at its root (S, C and Q)*. Then each directory should have the files containing the results in a file named with the key in the where clause. The format of the contents should be something similar to JSON (XML just takes too much work).
So when the AJAX request is sent, all it has to do then is get that file and print its contents (the client-side script parses that data already). At that point, the number of queries per second would’ve been reduced to a near-constant rate of 2 (excluding authentication).
Wow, parang ALGOCOM na rin.
*I think McDonald’s used it too. I think it was “service cleanliness and quality”.
![iRant | [root@jploh.com ~]# cat /var/log/irant_](http://blog.jploh.com/wp-content/themes/default2/images/blog_jplohcom.jpg)

The introduction showed how the hackers do it. They explained a couple of 1337 jargons and expanded abbreviations. They show the damages, figures and the victim, AT&T. The “hackers” are alleged to be from the Philippines who stole access codes to various AT&T corporate clients.
Archives