Ticket #326 (closed enhancement: wontfix)
Memcached Form State Handler
|Reported by:||alex94040||Owned by:||somebody|
Contribution by jragomes.
My first little contribution to Qcubed Project. I wrote a simple (and working) Memcached Form state handler. I wrote that because Memcached is a well supported caching system for PHP.
The benefits of using Memcached?
I've used apache benchmark to run some tests. Usually, we use FileFormStateHandler? because it is safer and do not takes a lot of networking on sending data to the browser.
In my tests I used a real login page. In this page 3 controls are built: Login, Password and Send Button.
The command was #ab -n 1000 -c 20 http://server/login.php, which means:
-n 1000 = 1000 requests
-c 20 = 20 of concurrency
Using QFileFormStateHandler this test was executed in 38.786 seconds.
Using QMemcachedStateHandler was executed in 28 seconds. What means 39% more responsive.
The explation is simple:
Memcached uses the server memory to store data, what is pretty fast. The garbage collector is done by memcached automatically, there is no slowdown of HD I/O.
I think the code can be better, I am waiting for contributions and ideas.