note 81339 rejected from ref.pgsql by nlopess
| From: | nlopess@php.net | Date: | Sat, 23 Feb 2008 12:13:57 +0000 |
| Subject: | note 81339 rejected from ref.pgsql by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136438@lists.php.net to get a copy of this message | ||
Note Submitter: turbinater at gmail dot com
----
There's something seriously flawed with PHP's implementation of the PostgreSQL extenstion.
By simply executing this statement:
$con = pg_connect("dbname=db1 user=db1user host=127.0.0.1 password=password");
The number of requests per second my script can handle drops from 2100 requests/second to 100
requests/second (as seen by ab -c 10 -t 30 http://localhost/script.php). This has been reproduced on
three of my systems, and PHP doesn't have any problem like this with MySQL. This is a PHP
problem, not a PostgreSQL problem. Python and Ruby don't have this problem with PostgreSQL.
It's insane, because I ported the same script to Python and it's much faster with
PostgreSQL than with MySQL (~1400 requests/second for PostgreSQL, ~1000 requests/second for MySQL).
I'm going to try the latest CVS version of PHP 5, and see if it fixes it. Any ideas why this is
so slow on PHP?