Page 1 of 1

Unable to run scripts in parallel

PostPosted: 29. April 2010 04:33
by mapron
Problem: on one script (PHP or perl) request, requests are not executing parallel, but apache had a lot free processes. (exactly, only 1 process is busy);
It is noticable on scripts PHP and Perl.

I has googling for three days, but not found answer on wuestion: how make script run parallel?

I use Zend Framework, and ajax requests process through index.php as usual request - but during long request (5-30 seconds) site is unavailable!!
It is not problem with High load, but with load at all cases.
All popular CMS uses one (!) index.php file for resolving on all requests, so if one response takes long time - all customers will be waiting.

Problem has been tested on three machines: mine (ubuntu ), working (windows) and out server with centos.
programms versions are the same:
PHP 5.2, perl 5.10, apache 2.2.,

testcase:
Code: Select all
<?php
$a=1;
for ($i=0;$i<1E7;$i++) $a=$a*1.1;
echo microtime(true);


or

Code: Select all
#!/bin/perl
print "Content-type: text/html;\r\n"
sleep(10);
print "aaaaa";


p.s. If one of these scripts run in console (or registered in cron), all ok - even complex scripts running parallel without problems.
But if i load script in browser in two tabs, they executed in order of queue.

p.p.s. sorry for bad english. russian is native.