Skip to content

Instantly share code, notes, and snippets.

@imarcelolz
Forked from chrismeller/gist:4747097
Last active December 20, 2015 18:19
Show Gist options
  • Save imarcelolz/6174867 to your computer and use it in GitHub Desktop.
Save imarcelolz/6174867 to your computer and use it in GitHub Desktop.
[www]
; at any time, there can be no more than 5 child processes
; if you know how much memory each process consumes regularly
; and how much free memory you have on your system, this is how
; you set a "hard limit" on the amount of memory php-fpm will be able to consume
pm.max_children = 5
; when php-fpm first starts, how many processes should
; it immediately generate to handle requests?
; when you restart php-fpm, there may be an influx of requests.
; spawning a new process can take time (albeit very small), so we want
; to go ahead and have this many ready to go
pm.start_servers = 2
; if there are no requests currently, how many spare
; processes should we always make sure to keep around?
; again, there is a delay in spawning new processes,
; so having a few always ready to go is a good idea.
; the offset is that they will be taking up memory that your system
; might otherwise be able to use for other things
pm.min_spare_servers = 1
; the inverse of the former. if there's nothing going on,
; how many spare processes are we allowed to keep around?
; again, fewer means more memory on the system for other things,
; but more means less of a delay if an influx of requests comes in
pm.max_spare_servers = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment