Skip to main content

Best way to limit php.ini settings

Comments

10 comments

  • ankeshanand
    You can limit them through Virtualization of LVE Manager. LVE Manager is a CloudLinux Addon which Allows you to limit each customer's resources. By Default, It limits each user to 1 Core CPU and 1GB RAM and 1MB/s IO/s but you can change it as well.
    0
  • cPRex Jurassic Moderator
    CloudLinux would definitely be the way to go here.
    0
  • coursevector
    OK, thanks for the feedback. CloudLinux is a bit pricey so we only have it on a few servers but good to know. So the memory limit is per process and not cumulative correct?
    0
  • cPRex Jurassic Moderator
    CloudLinux memory and CPU limits would be set per-user.
    0
  • coursevector
    OK, so if i set a memory limit of say 128MB for a user. Does that mean the user can have 2 processes using 128MB each or 2 process totally 128MB?
    0
  • cPRex Jurassic Moderator
    In your example, that would mean those 2 processes, or however many processes the user had running, could not exceed 128M.
    0
  • coursevector
    Gotcha ok. So there is nothing to limit per process (which is what suhosin did), correct?
    0
  • ankeshanand
    OK, so if i set a memory limit of say 128MB for a user. Does that mean the user can have 2 processes using 128MB each or 2 process totally 128MB?

    It depends upon user process. A total of 100 CPU Process can also run on 128MB. PHP.ini Limits are Based on Limits of each site. For example, Of you set php.ini to 1G, The site can only occupy 1G of RAM. But of Course, Users can edit php.ini so to Limit Per user, CloudLinux LVE is used.
    0
  • cPRex Jurassic Moderator
    Gotcha ok. So there is nothing to limit per process (which is what suhosin did), correct?

    Correct - with the limit placed on the overall cPanel user, a per-process limit isn't really needed.
    0
  • ankeshanand
    Gotcha ok. So there is nothing to limit per process (which is what suhosin did), correct?

    Suhosin is for Preventing bugs. Like any bug can trigger full RAM usage. Suhosin is not recommend in Shared Hosting as it can degrade performance adversly. and I also don't know if cPanel would even work correctly with the extension as it may break any process in between!
    0

Please sign in to leave a comment.