ID: 21189 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: GD related Operating System: windows 2000/sp3 PHP Version: 4.3.0RC4 New Comment:
Small note, TTF library is not thread safe, meaning that in Win32 enviroment it may not operate well. Previous Comments: ------------------------------------------------------------------------ [2002-12-26 04:55:12] [EMAIL PROTECTED] Hello! I made crash tests using WebRoller software. I set to 10 requests my PHP code from 50 virtual clients simultaneously, and run 40 iterations. I test php with php_gd.dll and php_gd2.dll. in second case apache generates error on windows console (GPF) I use next code: <?php error_reporting(E_ALL); $img="tab100x25.png"; header("content-Type: image/png"); $text ="qwe"; $textlen = strlen($text); $im = ImageCreateFromPng($img); $tab_color = ImageColorAllocate($im, 255, 255, 255); $txt_color = ImageColorAllocate($im, 0,0,0); $itSize=GetImageSize($img); $t_size = 11; ImageFill($im, 9 , 17, $tab_color); ImageTTFText($im, $t_size, 0, 10, 10, $txt_color, "arial.ttf", $text); ImagePng($im); ImageDestroy($im); ?> after crash test my system was frosen,apache haves 99% CPU and a lot of memory. As next, I comment string with ImageTTFText function and test it again. Apache lives! Below I will provide output from WebRollers test results: Results from WebRoller with TTF function: --- Start statistics --- --- Basic statistics --- Min: 50.00 20.00 30.00 50.00 70.00 60.00 30.00 30.00 Avg: 514.82 602.53 785.38 827.82 378.96 238.82 200.40 199.07 Max: 3270.00 4990.00 6350.00 7550.00 3410.00 2680.00 510.00 560.00 --- Network traffic details --- Total bytes sent : 124242 Total bytes received : 347208 Average input speed : 1152 bytes/sec --- Summary times --- Virtual Clients statistics: Count Time AR/S AT/R 100 1322442 0.08 13224.42 110 1290436 0.09 11731.24 101 1320349 0.08 13072.76 101 1320809 0.08 13077.32 114 1260793 0.09 11059.59 110 1262395 0.09 11476.32 99 1234395 0.08 12468.64 101 1293280 0.08 12804.75 101 1320759 0.08 13076.82 111 1263257 0.09 11380.69 Total work time: 1337293 Total requests made: 1048 Total average time per request: 1198.4126 Total average requests per second: 0.8344 --- Errors report --- Total 425 errors!!! Net :6 T/O :419 --- HTTP response codes details --- Code Count 200 629 --- End statistics --- Results from WebRoller without TTF function: --- Start statistics --- --- Basic statistics --- Min: 60.00 110.00 90.00 100.00 100.00 100.00 50.00 40.00 Avg: 188.26 189.40 189.84 189.44 190.40 188.78 187.64 187.96 Max: 240.00 280.00 310.00 330.00 290.00 260.00 270.00 280.00 --- Network traffic details --- Total bytes sent : 475530 Average output speed : 475530000 bytes/sec Total bytes received : 1844000 Average input speed : 2382 bytes/sec --- Summary times --- Virtual Clients statistics: Count Time AR/S AT/R 400 78002 5.13 195.01 400 78052 5.12 195.13 400 77862 5.14 194.66 400 78162 5.12 195.41 400 78262 5.11 195.66 400 78202 5.11 195.51 400 78122 5.12 195.31 400 78202 5.11 195.51 400 78232 5.11 195.58 400 77942 5.13 194.85 Total work time: 78342 Total requests made: 4000 Total average time per request: 19.5948 Total average requests per second: 51.0341 --- HTTP response codes details --- Code Count 200 4000 --- End statistics --- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21189&edit=1