1

If a server receive multiple high memory consuming requests, the server will queue the requests or put all the requests in RAM causing problems to server.

I understand that I can limit requests with 'memory_limit' in php.ini, but for example if a server with 4GB RAM and memory_limit 1024M receive at same time multiple requests that in total exceed the value of RAM what will happen?

1
  • The script that is able to get memory allocated would execute and other would not. Commented Jul 7, 2018 at 10:34

2 Answers 2

2

If server receiving high memory consume request then you may get error like "out of memory" in log or browser.

You need to debug and find out in the code where it takes much time & consuming memory. Based on that try to optimize the code ( optimization is depends on code structure).

Sign up to request clarification or add additional context in comments.

Comments

1

The server will try to do all task at the same time.

So if this is an issue you will need to optimize memory consuming task or use some tool to store request in the queue.

The example is maybe a composer require command. If the process requires more memory than server has, a process will be simply killed.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.