Frequently asked questions

Which resource limits do you have for PHP?

PHP limits

Configuration settingPHP 5.5 and 5.6Max limit
max_execution_time 30 60
max_input_time 60 60
memory_limit 129M 256M
max_input_vars 1000 5000
post_max_size 128M 128M
upload_max_filesize 128M 128M

Can I increase the limits?

Customers with a concrete need for higher limits, may increase these manually, up to but not beyond the limits listed above in the column Max limits.

These changes may be added one by one in .user.ini.


.user.ini for higher max_input_vars

max_input_vars = 3000

PHP 5.6 and uWSGI

PHP 5.6 is configured with uWSGI based on the "emperor-vassal" model. A webhotel's PHP is served by a vassal. Each virtualhost starts with 1 vassal, and may use up to 4 vassals simultaneously. This makes PHP more efficient and limits the resources used, and reduces the risk of overload.

System limits

Max CPU time per process 60 sec
Max real memory usage per process 600 MB
Max processes per user 25

If these limits are exceeded, you'll most likely see error code 500 "Internal Server Error". These limits cannot easily be handled by PHP or CGI themselves.

Additionally, ImageMagick is limited to use approximately 500 MB for pixel and rendering cache. The combined limits are sufficient to permit WordPress import of 24 Mpx JPEGs and somewhat larger PNGs.

What does this mean, and why?

  • CPU-time is a more generous limit than wall clock time, it's how long the process can run with 100% CPU usage. The limit is high because some maintenance processes in e.g. WordPress take more time than normal webpages, up to 20-30 seconds. Web software should never use anywhere near this long to serve a webpage.
  • Real memory usage is considerably higher for PHP than what PHP itself keeps track of, which means we need to permit more than 129/256 MB. This doesn't mean that it's okay for you to take advantage of this, please keep your memory footprint low.
  • Processes per user equals the number of concurrent PHP 5.5 scripts/programs, or PHP 5.6 vassals, plus programs started by PHP. Assuming a normal runtime of 5 seconds, and sensibly configured webpages, this limits permits several thousand visitors an hour.

If software exceeds the limits for CPU time or real memory usage, it is out of resources, and terminated immediately by the OS. This can principally be detected by PHP itself, or the CGI software, but in practice, we find that this is not handled well. This is why all these limits are greater than what a website strictly needs to run properly, and more than the limits imposed by PHP itself.

If a 26th concurrent process tries to start, it will not start. Any processes currently running are unaffected by the process limit.

Can I increase the system limits?

No, these are hard limits. If you need more resources, then your needs exceed those that can be provided with a webhotel. Consider a dedicated server or virtual private server (VPS) instead.

See also:



© 2017 Domeneshop AS · About us · Terms & Conditions · About cookies