Hoo Host Posted June 13, 2019 Report Share Posted June 13, 2019 Hi all, any input on this or even confirmation that it's an issue that others have encountered would be greatly appreciated: I just recently made the upgrade to Uniserver Zero XIII with PHP 7.0. The issue is that half my sites (mainly WordPress but that's irrelevant) keep failing with out of memory errors. These same sites worked just fine on the older Uniserver Zero XI. I have written a little script to illustrate what is happening - PHP is ignoring the set memory limit and restricting it to some amount under 408MB. It doesn't matter if it is set in the php_production.ini file, via .htaccess, or via ini_set() in the php script itself. As you can see from the phpinfo.html output below it is configured at 2048MB (I have also tried at 512 and 1024 with no difference in results). I have tried installing the PHP 7.1 module with no luck there either. Here is my phpinfo: http://hoohost.com/dev/us/phpinfo.html 16GB physical RAM, never close to using half of it. Test script - note that the output shows that it never allows more than ~408MB (240MB after loading other local sites) even though it is set to max out at 2048MB in php,ini config: <?php echo "Memory limit: ".ini_get("memory_limit")."<br><br>"; $a=array(); if (ob_get_level() == 0) ob_start(); for($i=0;$i<200;$i++) { $a[]=str_pad('',1024*1024*8); echo "Pass ".$i.", memory used: ".number_format((memory_get_usage())/(1024*1024),0)." MB<br>"; ob_flush(); flush(); } ?> Output: after starting UniServer Apache without loading any other local sites:Memory limit: 2048MPass 0, memory used: 11 MBPass 1, memory used: 21 MBPass 2, memory used: 31 MBPass 3, memory used: 41 MBPass 4, memory used: 51 MBPass 5, memory used: 61 MBPass 6, memory used: 71 MBPass 7, memory used: 81 MBPass 8, memory used: 91 MBPass 9, memory used: 101 MBPass 10, memory used: 111 MBPass 11, memory used: 121 MBPass 12, memory used: 131 MBPass 13, memory used: 141 MBPass 14, memory used: 151 MBPass 15, memory used: 161 MBPass 16, memory used: 171 MBPass 17, memory used: 181 MBPass 18, memory used: 191 MBPass 19, memory used: 201 MBPass 20, memory used: 211 MBPass 21, memory used: 221 MBPass 22, memory used: 231 MBPass 23, memory used: 241 MBPass 24, memory used: 251 MBPass 25, memory used: 261 MBPass 26, memory used: 271 MBPass 27, memory used: 281 MBPass 28, memory used: 291 MBPass 29, memory used: 301 MBPass 30, memory used: 311 MBPass 31, memory used: 321 MBPass 32, memory used: 331 MBPass 33, memory used: 341 MBPass 34, memory used: 351 MBPass 35, memory used: 361 MBPass 36, memory used: 371 MBPass 37, memory used: 381 MBFatal error: Out of memory (allocated 400556032) (tried to allocate 8388632 bytes) in C:\Uniserver\www\util\memtest.php on line 9 Output: after loading another local (in this case WordPress) site's admin page:Memory limit: 2048MPass 0, memory used: 11 MBPass 1, memory used: 21 MBPass 2, memory used: 31 MBPass 3, memory used: 41 MBPass 4, memory used: 51 MBPass 5, memory used: 61 MBPass 6, memory used: 71 MBPass 7, memory used: 81 MBPass 8, memory used: 91 MBPass 9, memory used: 101 MBPass 10, memory used: 111 MBPass 11, memory used: 121 MBPass 12, memory used: 131 MBPass 13, memory used: 141 MBPass 14, memory used: 151 MBPass 15, memory used: 161 MBPass 16, memory used: 171 MBPass 17, memory used: 181 MBPass 18, memory used: 191 MBPass 19, memory used: 201 MBPass 20, memory used: 211 MBPass 21, memory used: 221 MBFatal error: Out of memory (allocated 232783872) (tried to allocate 8388632 bytes) in C:\Uniserver\www\util\memtest.php on line 9 Quote Link to comment Share on other sites More sharing options...
Hoo Host Posted June 20, 2019 Author Report Share Posted June 20, 2019 I found a solution! But since nobody is capable of replying I'm not going to explain. Good luck! Quote Link to comment Share on other sites More sharing options...
vwdragon Posted January 7, 2020 Report Share Posted January 7, 2020 On 6/20/2019 at 8:06 AM, Hoo Host said: I found a solution! But since nobody is capable of replying I'm not going to explain. Good luck! Where is solution? Quote Link to comment Share on other sites More sharing options...
sudeepjd Posted January 15, 2020 Report Share Posted January 15, 2020 If the script posted by @Hoo Host is giving you out of memory errors even before the maximum memory limit is reached, it is probably limited by the ThreadStack size by Apache as well. You can try increasing the ThreadStackSize in the core/apache2/conf/extra/httpd-mpm.conf file. By default this is set at 64*1024=65536. Please note that increasing this also affects the allocated memory to other running processes on your system so do this at your own risk. Quote Sudeep D'SouzaDeveloper at UniformServerThe Uniform Server | My Paper Napkin Collection Link to comment Share on other sites More sharing options...
Hoo Host Posted January 16, 2020 Author Report Share Posted January 16, 2020 Ok fine, here's what worked in the end: Update core/apache2/conf/extra/httpd-mpm.conf and change ThreadsPerChild from 150 to 50 on line 106 under <IfModule mpm_winnt_module> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.