Ticket #326 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 3 years ago

Memcached Form State Handler

Reported by: alex94040 Owned by: somebody
Priority: important Milestone: 2.0.1
Component: Other Version: 1.0.0 RC2
Keywords: formstate memcached Cc:

Description

Contribution by jragomes.

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.

Attachments

QMemcachedFormStateHandler.class.php Download (2.1 KB) - added by alex94040 4 years ago.
Implementation from jragomes

Change History

Changed 4 years ago by alex94040

Implementation from jragomes

Changed 4 years ago by MikeHostetler

  • status changed from new to in_QA

Changed 4 years ago by alex94040

  • milestone changed from 1.1 to 1.2

We need someone to review this.

Changed 4 years ago by VexedPanda

I don't have memcached, so I'm not able to.

Changed 3 years ago by MikeHostetler

  • status changed from in_QA to assigned

Tested and found to be broken.

Changed 3 years ago by MikeHostetler

  • status changed from assigned to closed
  • resolution set to wontfix

So, I ended up solving this by configuring PHP on the server to make use of memcache to store normal PHP sessions.  Then, I just enable the QSessionFormStateHandler class and voila, memcache'd form state.

Changed 3 years ago by alex94040

  • milestone changed from 1.2 to 2.0.1
Note: See TracTickets for help on using tickets.