By aywebdev
Hello!
I own the website http://ninjackpot.com
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!
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!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.