News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Johannes Schlüter's Blog:
Testing persistent connection and thread-safety features in PHP
March 22, 2012 @ 09:51:58

In this recent post to his blog Johannes Schlüter he talks about a way that he's come up with to test functionality that uses persistent connections (and an module he created to help).

In a few rare cases this is not what people like, for that PHP introduced "persistent connections" of different kinds. Testing those is a bit annoying as you have to configure a webserver and ensure to hit the same instance over the course of a test and then use a load generator, probably one which can detect a failure. Additionally by having a webserver in the game there is more code being executed, which might mean an additional source for trouble while debugging. An alternative might be using FastCGI, while that adds it's own issues for such a test. To solve this for myself I, some time ago, wrote a PHP SAPI module called pconn and pushed it to github.

The extension provides a way to emulate requests by executing a script multiple times automatically, making it easier to test things that require checking against multiple things simultaneously. While the built-in webserver (PHP 5.4) can be used to test some of these things too, Johannes' extension can also be compiled to help with testing of threading in applications as well.

0 comments voice your opinion now!
testing persistent threat safe extension sapi module webserver


blog comments powered by Disqus

Similar Posts

International PHP Magazine: IPM Poll Question: Which Is the Best Way to Do PHP Web Testing?

Christopher Kunz's Blog: Thoughts on ext/filter et al.

Alex Mills' Blog: Why WordPress Doesn't Have Built-In Persistent Caching

php|architect Blog: Professional Programming: DTAP - Part 2 : Other moving Pieces

Pierre-Alain Joye's Blog: Initial PHP4 support for htscanner


Community Events

Don't see your event here?
Let us know!


language wordpress laravel5 extension interview framework laravel release community api voicesoftheelephpant series library development unittest opinion introduction conference podcast middleware

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework