hiviyan's avatar

How to check if the current server capacity is hitting its limit for Laravel app

Hi,

I have a small laravel app that is currently running on a rental server. It is running fine now but more users will start using the app soon, and I want to make sure that ther will be enough capacity for my app to handle all of these requests. I can upgrade my rental server to a higher service. But, I am wondering how we techincially should decide if it is a time for upgrade.

What is the best way to determine if the current server capacity is hitting its limit? How do you monitor the perfomance of your Laravel apps? Do you guys use Sentory.io or any other similar services?

Any input is highly appreciated.

0 likes
5 replies
LaryAI's avatar
Level 58

To determine if the current server capacity is hitting its limit for your Laravel app, you can monitor various performance metrics. Here are a few steps you can take:

  1. Monitor CPU and Memory Usage: Keep an eye on the CPU and memory usage of your server. If the usage consistently reaches high levels, it may indicate that the server is struggling to handle the load. You can use tools like top or htop on Linux servers to monitor these metrics.

  2. Monitor Response Time: Measure the response time of your application. If the response time increases significantly as the number of users grows, it could be a sign that the server is reaching its limit. You can use tools like New Relic or Blackfire to monitor response times and identify performance bottlenecks.

  3. Monitor Database Performance: Check the performance of your database queries. Slow queries can impact the overall performance of your application. Laravel provides a query log that you can enable to monitor the queries being executed. You can also use tools like Laravel Debugbar or Laravel Telescope to analyze database queries and identify any performance issues.

  4. Load Testing: Perform load testing on your application to simulate a high number of concurrent users. Tools like Apache JMeter or Gatling can help you simulate heavy traffic and measure the performance of your application under load. By analyzing the results, you can determine if the server can handle the expected increase in users or if an upgrade is necessary.

  5. Monitor Server Logs: Regularly check your server logs for any errors or warnings. These logs can provide insights into any issues that may be affecting the performance of your application.

Regarding monitoring services, Sentry.io is primarily used for error tracking and exception monitoring. While it can help identify issues in your application, it may not provide real-time performance monitoring. For performance monitoring, you can consider services like New Relic, Datadog, or AppDynamics.

Remember, monitoring server capacity is an ongoing process. It's important to regularly review and analyze the performance metrics to ensure your application can handle the expected load.

krisi_gjika's avatar

careful enabling Telescope in production, as that itself has a performance impact and storage impact if you don't clear the logs often.

1 like
PovilasKorop's avatar

@hiviyan personally I use Digital Ocean for most projects so just looking at their monitoring of CPU / RAM / HDD gives me all I need to know at a glance.

But there are automated tools for that, like https://ohdear.app/ and the ones mentioned by Lary.

1 like

Please or to participate in this conversation.