Why is my site super laggy?


I own the website

I have upgraded the server, it is now flexible 40$/month and when 100 people are online the site gets super laggy and most of the times goes down.

Could anyone give any advice or suggestion on what i should improve and what may be the reason for this?

Thanks in advance!

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This type of question comes up more often when resizing is used to address a performance issue without the performance bottleneck being identified. Profiling applications and isolating the performance bottleneck is a very complex topic, as each phase of the process could lead to its own science.

When I handle this type of review for my projects, I typically start with the simpler questions. Is this a network issue or web server issue? Is the lagging aspect in the client side interaction, or server response? From there, I typically try loading static resources, and if those are not showing any issues loading, I can be confident the connection between myself and the server are okay.

Going into the application is a lot trickier. For php applications, you can use something like xdebug to get a profile of the way the code operates. If the application calls external resources ( e.g. a database, third party web service, etc ), you may find that the application spends a significant amount of time waiting on those. Other cases may show that it iterates through objects in the code repeatedly, or perhaps there is a buggy “sleep” call hidden in the code that someone forgot to remove.

In the frequent case of database bottlenecks, you can determine the longer running queries. There are a lot of resources out there for this alone, and work to optimize the database performance. It can easily impact things, as a query that ran quickly when the site first launched may have ballooned to several hundred thousand rows of data that get checked. Optimization in this department could range from adding some indexes in the database, to restructuring the code of the application and schema.

In short, you always want to start with testing the basics then profiling the application and service configurations to identify the performance bottlenecks as each case is different. This may not always be an easy issue to improve, but it will typically be the most appropriate one and provide you insight to issues that would impact your site at a larger scale as your viewer base increases over time. Hopefully this helps you get started.