From: Klaus R. <k...@ai...> - 2004-01-12 08:46:30
|
Hello, Using response.write() instead of print indeed boosts the performance. It's still not fast as PHP but speed is at a level which is ok for me. It's clear that doing 1350 single calls to print/repsonse.write is not really something a real program will do. But I have not the time to do some REAL coding, I'm just checking the speed ;-) So I tried another thing. Still in mind that I want to test the performance of Spyce in competition to PHP by using large include files. So I used the same scripts (One 20 KB main file, five 20 KB Include files). I replaced all the response.writes with "a = a + 1". The main files initialises "a" with 0 and outputs the variable at the end of script (Output is 1350, which means, I'm executing 1350 times the line "a = a + 1". I'm not doing it in a loop, because I want to have LARGE scripts.). This time the benchmark was nice to read. PHP gives me 20 Requests/s, while Spyce gives me 64 Requests/s. This sounds good, very good. But... There seems to be a problem somewhere. SOMETIMES the benchmark runs fine, gives me great numbers and the CPU usage is at normal level (It goes down but even not so deep as with PHP). But OTHER times the CPU usage goes to 100% (It's definitely the apache processes handling my bench mark requests) and I end up with 6 Requests/s. I'm not sure what's going on there. It looks like sometimes the scripts are compiled again while the bench mark is running: Percentage of the requests served within a certain time (ms) 50% 12 66% 12 75% 12 80% 12 90% 13 95% 6654 98% 6767 99% 6834 100% 7057 (last request) This looks to me as 90% of the requests were served through the cached scripts. But then the cache was rebuild for some reason. This takes some seconds and during this stage the CPU is at 100%. And maybe the requests are locked during this process. How does the memory caching exactly work? Is this ONE cache for all apache processes (Using shared memory or something like this) or does each apache process have it's own cache? Remember that I'm using Apache 1.3, not a threaded Apache 2. -- Bye, K <http://www.ailis.de/~k/> (FidoNet: 2:240/2188.18) [A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391] (Finger k...@ai... to get public key) |