QMemcachedFormStateHandler

Login or register to post comments
6 replies [Last post]
Offline
Joined: 11/25/2008

Hi Everyone,

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.

alex94040's picture
Offline
Joined: 11/06/2008

This is extremely exciting work, thank you so much for your contribution! Would you mind actually creating a ticket in our Trac and attaching your code to it? That would simplify our review process.

Offline
Joined: 11/25/2008

No problem at all, Alex. I will do it this night.

Thanks for the comment.

alex94040's picture
Offline
Joined: 11/06/2008

I just opened a Trac ticket to integrate your work: http://trac.qcu.be/projects/qcubed/ticket/326

Since it's best to keep feature discussions / code review discussions separate from the publicly-facing blog, I'll delete this blog post in a couple days, and we'll continue the discussion inside that ticket.

Thanks again for your contribution! We're very excited about it!

Offline
Joined: 03/31/2008

I disagree, the blog post should stick around. I have removed it from the homepage however.

MikeHostetler's picture
Offline
Joined: 01/09/2008

I agree with Vexed, lets just remove it from the front page. There's no harm in having is elsewhere. Perhaps we need to tighten permissions down a bit.

alex94040's picture
Offline
Joined: 11/06/2008

I didn't know you could keep the blog post but remove it from the front page :-) Thanks, folks!

And yeah, Mike, if you could tighten the permissions, that'd be great.