Highload server for special project in a social network. Load ~5000 requests/m

Started by flamefox16, Mar 23, 2023, 01:05 AM

Previous topic - Next topic

flamefox16Topic starter

Comrades, I kindly request your assistance in finding reliable services for hosting a special project with an iframe on the FB social network. The fine folks at FB have warned us about a substantial load of 25,000 connections in just 5 minutes. It would be greatly appreciated to hear the experiences of those who have hosted something similar and the reasoning behind their choice of services. Gentlemen igrodel, highloders, I humbly ask for a minute of your attention!

Here are a few additional details:

1) This is a JS application that renders the interface on the client side.

2) The code is in PHP, most likely using Yii.

3) We're considering MySQL, but we're not entirely sure yet (what are your thoughts on deadlocks + Yii?).

4) We plan on using a CDN for images and user-generated content (any recommendations, perhaps www.cloudflare.com?).

5) The application will integrate with the gift system from OK, and the load is expected to be high (they say people go crazy for freebies in this hospital).

6) Since the load will only peak temporarily due to the promotional mechanics, we prefer to find a hosting solution with payment for minimal discrete periods (e.g., hourly or daily).

Ideally, we have a budget for a proper system, such as Heroku along with additional services. We genuinely want to spend the money wisely on something that's truly worthwhile.


Any hetzner dedicated server can handle 1 request per minute, so 5000 requests per minute is far from a tragedy =) The load is manageable, but not considered highload.

If you are looking for hourly payment options, I suggest considering Scalaxy/Selectel clouds, as well as AWS Spot Requests. In certain regions, their prices are typically stable and consistently lower than those of normal instances.


Having only 5000 requests may not be sufficient, but the key is to design a scalable architecture in advance for future expansion.

If you have plans to scale your project in the future, I would not recommend using MySQL. Instead, consider implementing at least 5 less powerful servers with load balancing, and everything will work seamlessly for you.


If you plan on rendering on the client and using templates, a recommended option is hogan.js. However, keep in mind that templates should be compiled on the server.

Furthermore, if the rendering is based on JSON data, it would be advisable to consider using MongoDB instead of MySQL. MongoDB provides data in JSON format by default and can perform faster if indexes are properly set up.

Kitty Solam

Comrade, I understand your request for assistance in finding reliable hosting services for your special project on the FB social network. Let's go through each point and discuss the options available to you.

1) For a JS application that renders the interface on the client side, you might consider using a static site generator like Gatsby or Next.js. These frameworks can generate static HTML pages that can be served quickly by any hosting provider.

2) PHP applications, such as those built with Yii, can be hosted on various cloud platforms like AWS (Amazon Web Services), Google Cloud Platform, or Microsoft Azure. These platforms offer managed PHP hosting services with scalability options.

3) Regarding MySQL and deadlocks with Yii, it would be best to optimize your database queries and use appropriate locking mechanisms to minimize the chances of deadlocks occurring. You may also consider using a serverless or managed database service to offload the responsibility of managing deadlocks.

4) Cloudflare is a popular CDN provider and can be a good choice for hosting images and user-generated content. It helps improve performance by caching content closer to the users and mitigating DDoS attacks.

5) Integrating with the gift system from OK and expecting high load can be challenging. Ensure that you have proper caching mechanisms in place and optimize your code to handle the load efficiently. Load testing and performance profiling can help identify bottlenecks in your application.

6) Pay-as-you-go hosting solutions like Heroku can be a suitable option for your temporary peak load. Other cloud providers also offer similar pricing models, where you only pay for the actual usage during discrete periods.

7) Since you anticipate a substantial load in a short period of time, it would be wise to implement caching mechanisms at various layers of your application. This can help alleviate the strain on your hosting infrastructure. Consider using a caching layer like Redis or Memcached to cache frequently accessed data or database query results.

8) As your budget allows for a proper system, you may want to explore cloud-based solutions like AWS Elastic Beanstalk, Google App Engine, or Microsoft Azure App Service. These platforms provide managed application hosting with auto-scaling capabilities, which can help handle sudden spikes in traffic.

9) Monitoring and performance testing are crucial for ensuring the stability and responsiveness of your application. Set up monitoring tools like New Relic or Datadog to track the performance of your application and identify any bottlenecks or issues proactively.

10) Depending on the nature of your application and its requirements, you might consider using a microservices architecture. This allows you to break down your application into smaller, independent services that can scale individually and handle specific tasks. However, keep in mind that adopting a microservices architecture can introduce complexity, so weigh the pros and cons carefully.

11) Lastly, consider setting up a disaster recovery plan and implementing regular backups of your application and data. This will help you recover quickly in case of any unforeseen events or data loss.

12) Load balancing: To handle a high number of connections, you might want to consider implementing a load balancer in front of your application servers. This can distribute incoming traffic evenly across multiple servers, improving performance and reliability.

13) Auto-scaling: Look into cloud platforms that offer auto-scaling capabilities, such as AWS Auto Scaling or Google Cloud Autoscaler. These services can automatically adjust the number of instances based on the current demand, ensuring that you have enough resources to handle peak loads while also optimizing costs during periods of lower traffic.

14) Performance optimization: Take advantage of performance optimization techniques like code profiling, database query optimization, and caching to ensure that your application can handle the expected load efficiently. Use tools like XDebug or Blackfire for code profiling, and consider using an ORM (Object-Relational Mapping) library for improved database performance.

15) Global presence: If your target audience is spread across different geographic regions, consider using a Content Delivery Network (CDN) with a global presence. This will help reduce latency and improve the overall user experience by caching and delivering content from servers closer to your users.

16) Security: Ensure that your application is secure by implementing proper authentication mechanisms, input validation, and secure coding practices. Regularly update your software dependencies to address any security vulnerabilities.

17) Continuous integration and deployment: Set up a CI/CD (Continuous Integration/Continuous Deployment) pipeline to automate the testing, building, and deployment of your application. This can help streamline the development process, ensure code quality, and facilitate frequent releases.

18) Documentation and monitoring: Document your infrastructure setup, application architecture, and deployment process. Implement robust monitoring solutions to track the performance and health of your application and respond quickly to any issues that arise.

19) Disaster recovery and backups: Implement a robust backup strategy to ensure that your data is protected in case of any failures or accidents. Consider using automated backup solutions and storing backups in a secure offsite location.

20) Security and compliance: If your project handles sensitive user data or requires compliance with specific regulations, ensure that your hosting provider meets the necessary security standards and compliance requirements. Consider using SSL certificates for secure communication and encryption of sensitive data.

21) Scalability planning: Take the time to plan your scalability strategy in advance. Understand how your application can scale horizontally by adding more servers or vertically by increasing the resources on existing servers. Use load testing tools to simulate high traffic scenarios and plan your infrastructure accordingly.

22) Support and SLAs: Look for hosting providers that offer reliable customer support and service level agreements (SLAs). Having access to technical assistance when you need it can be crucial, especially during high-load periods or in the event of any issues.

23) Cost optimization: Continuously monitor your usage and costs on your hosting platform. Optimize resource allocation and consider implementing cost-saving measures such as scheduled shutdowns during periods of low traffic.

24) DevOps automation: Automate your infrastructure provisioning and deployment processes using tools like Terraform, Ansible, or Kubernetes. This will help streamline your operations, reduce human errors, and enable faster deployments.

25) Documentation and knowledge sharing: Maintain thorough documentation of your infrastructure, deployment process, and any custom configurations. This will facilitate easier onboarding of new team members and assist in troubleshooting any issues that arise.