ID:               40720
 Updated by:       [EMAIL PROTECTED]
 Reported By:      soadlink at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Performance problem
 Operating System: Ubuntu 6.10
 PHP Version:      5.2.1
 New Comment:

>Then why does Windows handle plenty of instances just fine?
Because your windows machine has more RAM?
Because the script doesn't actually work?
Because it works differently? 
I don't think I can tell you which of these is true.


Previous Comments:
------------------------------------------------------------------------

[2007-03-05 10:54:05] soadlink at gmail dot com

>If each instance takes say 100Mb to run, then it's quite expected
that
>10 instances running in the same time would take ~1Gb and make the
>machine to swap.

Then why does Windows handle plenty of instances just fine? I am trying
to get the Linux machine to handle the script instances the same way
Windows did. Linux lags after 1 or 2. Windows doesn't lag even with
8-12 running at once. Is there something inside Windows itself that is
handling it better than in Linux, or something in PHP I can change?

------------------------------------------------------------------------

[2007-03-05 10:46:20] [EMAIL PROTECTED]

>Yes. 
Ok, so that's not a real problem then.

>And when I increase the memory limit on Ubuntu to match this the
>script runs, but more than 1-2 instances of it running causes the
>machines memory usage to go very high and slow the performance of
>everything (including the script).

If each instance takes say 100Mb to run, then it's quite expected that
10 instances running in the same time would take ~1Gb and make the
machine to swap.


------------------------------------------------------------------------

[2007-03-05 10:38:38] soadlink at gmail dot com

>Well, must likely on Windows you're using default php.ini with
memory_limit = 128M

Yes. And when I increase the memory limit on Ubuntu to match this the
script runs, but more than 1-2 instances of it running causes the
machines memory usage to go very high and slow the performance of
everything (including the script). It doesn't do this in Windows XP Pro
SP2 though. I can have plenty of instances running when that OS is
installed with no problems.

>The code is quite useless, since we apparently cannot run it without
the "c:\\list.txt".

395000 line test file took 20 seconds to make -
http://zero-labs.net/list.zip

------------------------------------------------------------------------

[2007-03-05 10:08:57] [EMAIL PROTECTED]

>However I only have to increase the memory limit on Ubuntu, but not
Windows.
Well, must likely on Windows you're using default php.ini with
memory_limit = 128M

>See the 'reproduce code' for the code.
The code is quite useless, since we apparently cannot run it without
the "c:\\list.txt".

------------------------------------------------------------------------

[2007-03-05 01:40:29] soadlink at gmail dot com

Description:
------------
I am working with a script that loads a list into an array and then
echos each word in the array on a new line. See the 'reproduce code'
for the code.

I run my scripts with the CLI (not on a website), and it works great in
Windows XP when loading lists as large as 375,000 words, and I can run
plenty of instances of this script without lag issues (8+ command lines
going at once!). But when I try to run the same script on Ubuntu 6.10 I
get the following error: Fatal error: Allowed memory size of 8388608
bytes exhausted (tried to allocate 13491373 bytes). But that can easily
be fixed by setting a larger memory limit such as:
ini_set("memory_limit","75M");

However I only have to increase the memory limit on Ubuntu, but not
Windows. And when I do up the memory limit on Ubuntu, only 1 or 2
instances can be run before the machine starts to bog down and get VERY
slow. I'd assume this is because php is trying to load the entire list
into memory in Ubuntu, but I am curious as to why Windows runs it fine.
Is there something I can change on Ubuntu to make it run better? Or is
this a bug with the Linux version oh PHP?

The PCs are the same that I'm working with (I just removed the Windows
install recently and put Ubuntu on there), and it has 1GB of ram, and
an AMD64 3200+ processor. I'm just wondering if there is something I
need to change to get the script to run like it did on Windows,
...without being a memory hog or having to increase the memory limit
(since I didnt have to on Windows).

Reproduce code:
---------------
<?php
$loadlist = array_map("rtrim", file("c:\\list.txt"));
foreach ($loadlist as $word) {
echo ($word . "\n");
}
?>

Expected result:
----------------
I expect it to echo the words in the list (1 word per line). It works
fine on Windows, but on Ubuntu 6.10 it is very very laggy with multiple
instances, whereas with Windows it runs just fine. I can have dozens of
instances of the script running on Windows, but not Ubuntu.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40720&edit=1

Reply via email to