lyfsy

What kind of server to get for HAproxy for around 9.000 user

Dec 28th, 2019
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.51 KB | None | 0 0
  1. What kind of server to get for HAproxy for around 9.000 users online at the same time?
  2. I would like your recommendations about a HAproxy server specs that i would like to get for around 9.000 users online at the same time...
  3. ++++++++++++++
  4. list of top cheapest host http://Listfreetop.pw
  5.  
  6. Top 200 best traffic exchange sites http://Listfreetop.pw
  7.  
  8. free link exchange sites list http://Listfreetop.pw
  9. list of top ptc sites
  10. list of top ptp sites
  11. Listfreetop.pw
  12. Listfreetop.pw
  13. +++++++++++++++
  14. I prefer to get a dedicated server...
  15.  
  16. Also i would like your opinion of how to scale a database MariaDB around 80GB with 80% reads and 20% writes...
  17.  
  18. Should i use Maxscale or Proxysql? Keep all servers in sync at the same time or keep one server for writes and the rest for reads? How can i scale writes also?
  19.  
  20. I am finding sharding a bit complex for now...
  21. You would use servers to scale this not one monolithic server. You should also break everything out into microservices so you can scale each microservice independently of the other so you are not wasting resources and only pay for what you are actually using.
  22.  
  23. If you are well funded this is easy to resolve. Use AWS RDS for your database so you do not have to worry about scaling the hardware anymore. Use AWS Autoscaling groups so you do not have to manage adding and removing web servers. This way you do not have to worry if you have a concurrent 9,000, 90,000, or 900,000 users your architecture would autoscale to handle it if designed appropriately and you are not sitting with fixed hardware so you can save money by scaling down if your userbase goes down at certain times and back up if they go up. You can then use various options to measure metrics of your system use VPC peering to transfer data between data centers, etc. so you can reduce your potential downtime.
  24.  
  25. If you are strapped for cash you can go the less optimal route and purchase some servers. Normally you will want to have failover and high available in at least two datacenters. This would require you to setup at least two heavy duty database servers and webservers. If your site is highly dynamic you should have at least two HAproxy servers for high availability.
  26.  
  27. If you wanted to go big you could go with:
  28. 4x Dell R940s with 4x Processors, 1TB of RAM, and 2TBs of Flash Storage to reduce any potential IO bottlenecks, use dual or quad 10Gb or 40Gb fiber in active/active/active/active mode. If that is too expensive you can downgrade to an R740 with dual processors and a similar configuration. Just insure you have at least 2 physical machines for databases and 2x physical machines for your web servers. Throw in at least two 1U Dell R640 servers in HA for your HAproxy with enough RAM and fiber cards to push traffic. Then when you are ready insure you have the same setup in another datacenter several 100 miles away. You could save some money by getting read intensive SSDs, less cores, ram and network io if you are able to still handle the load across more physical servers.
  29.  
  30. lemeilleurptp.com
  31. hosting boom
  32. 1goldmine.com
  33. 9 hostage arts
  34. image24x7.com
  35. legacyteamcoop.com
  36. wordlinx.com
  37.  
  38. If you want more flexibility and options you could make these several 1U or 2U servers to enable more flexibility in load balancing users, database and application calls. Either way just insure you have high availability to reduce headaches when you need to do maintenance, hardware fails or you need to add more systems to maintain user growth. Normally this would all be done in the cloud due to having more options available for scaleability, security and more at scale.
  39. 1. Depends on what makes up those 9,000 concurrent users whether it's a forum/web app reported metric over a session interval which can mask real concurrent user activity i.e. 9,000 concurrent forum users over a 15 minute interval measurement could vary greatly - ranging from 9,000/(15x60) = 10 concurrent users/second to 9,000 concurrent users really simultaneously loaded = 9,000 concurrent users. Usually, it's somewhere in between if a session duration is involved in the reporting metric. So you need to measure and monitor your usage and pin point exactly your real concurrent user load at various levels of your web stack, haproxy load balancer, web server origin backups (nginx/apache/litespeed), php/php-fpm, mysql server and any distributed cache servers like memcached/redis.
  40.  
  41. 2. With that said, Haproxy itself as a load balancer doesn't use much resources and properly configured latest version Haproxy 2.1+ should easily handle quite a bit of concurrent user traffic. I've optimised and configured custom built Haproxy binaries even back on 1.9 to handle on a single Intel Xeon E3-1270v5 Skylake or E3-1270v6 Kaby Lake with 10Gbps network to push up to 350,000 concurrent Haproxy connection requests per second - but with higher than acceptable latency probably to due being 10Gbps network limited. Comfortably, I'd say around 50,000 to 80,000 concurrent connections/second per Haproxy server only really limited by your network capacity pipe >10Gbps etc and average size of request data served.
  42.  
  43. 3. Web server scaling depends on how you install/configure your web server. I've pushed my own custom built Centmin Mod Nginx binaries to around same 80,000 to 350,000 concurrent user requests/second on a single Intel Xeon E3-1270v5 Skylake or E3-1270v6 Kaby Lake with 10Gbps network with response latency varying from acceptable to much higher but server still handled it. But again depends on average size of request data served.
  44.  
  45. 4. PHP and MySQL performance - key would be how much load can you offload to various levels of caching from MySQL cache, PHP cache, web server level cache, Haproxy and even frontend CDN web accelerators like Cloudflare can make a huge difference as to how much they can respectively scale. Caching would need to be optimised for guests and logged in members. Then last part is optimal MySQL scaling would require MySQL replication or clustering with optimal MySQL proxy depending on how you want to scale so MaxScale or ProxySQL or Haproxy.
  46.  
  47. 5. Optimal configuration of all above mentioned components and then pair it with an optimal server hardware configuration with load balancing at both web server level and at MySQL database server level (MySQL replication/clustering) would be needed.
  48.  
  49. Don't underestimate how powerful today's server hardware is - it can handle so much more load when optimally configured. For instance on 10+ yr old single cpu Intel Xeon Lynnfield based servers (3 load balanced web + 1 mysql server), I could easily handle 500,000+ unique IP visitors/day or up to 60,000 concurrent users for vBulletin forum + Wordpress blog + Drupal mix based web site back in 2009 and without Cloudflare in front ! This was when both PHP and MySQL servers didn't performance and scale as well as they do now !!!
  50.  
  51. But putting optimally configured Cloudflare CDN and web accelerator in front of your setup will help alot too. Cloudflare caching would need to be optimised for guests and logged in members which can be done on Cloudflare Business or higher plans or via custom Cloudflare Workers you can write to replicate same or more advanced versions of Cloudflare Business plan's full HTML page guest cache or combine with CF Business plan's logged in user dynamic request acceleration features (Railgun).
  52.  
  53. Probably best to load test and benchmark your usage requirements first. There's a few bare metal dedicated providers who charge hourly billing like Packet.net or Vultr so you isolate your testing without the impact virtualized environments / VPS may have with other neighbours competing for resources. Vultr has up to 10Gbps network support while Packet.net has 10-40Gbps depending on how you configure networking. Sure they limit selection of hardware, but for hourly billing you can test relatively cheaply and benchmark/load test your usage requirements to see where you stand first.
  54.  
  55. It's an exciting time for server hardware and PHP i.e. PHP 7.4 with FFI and Opcache Preload features and MySQL/MariaDB/Percona MySQL advancements in performance and scalability
  56. It is a forum site...
  57.  
  58. I would like a few more info and which one do you recommend me for the database? Replication or clustering?
  59.  
  60. Amazon service for the moment.....
  61.  
  62. Maxscale seems an easy and good solution but if one server delay for a reason all database servers will slow down as all they must be in sync...
  63.  
  64. Don't know what's the + for replication and if you think it will be better for my case scenario...
  65. If your forum software supports multiple frontends that would be the best option to use then you can use auto scaling groups to manage the load automatically.
  66.  
  67. With MariaDB/MySQL it supports one master and multiple slaves, the slaves are what your site reads from which is great for you since you said 80% read and the master would take care of the 20% write with RDS you can have high availability with the multiple AZs like everyone should be running their sites if they are large and their main money maker.
  68. For your database use Amazon RDS so you no longer need to worry about scaling it, Amazon will do it for you. When you setup the database insure you select multiple Availability Zones and Read Replicas and you are golden and do not have to worry about that anymore. AWS is from competition the best option with the most options. Then you can setup regular S3 db dumps and then store them in Glacier.
  69.  
  70. If your forum software supports multiple frontends that would be the best option to use then you can use auto scaling groups to manage the load automatically.
  71.  
  72. With MariaDB/MySQL it supports one master and multiple slaves, the slaves are what your site reads from which is great for you since you said 80% read and the master would take care of the 20% write with RDS you can have high availability with the multiple AZs like everyone should be running their sites if they are large and their main money maker.
  73. Only makes sense if you're running a for-profit site that can cover the cost of running Amazon RDS and also cover the unexpected cost of any additional auto scaling incurred charges.
  74.  
  75. Example from Amazon RDS MariaDB pricing calculator https://aws.amazon.com/rds/mariadb/pricing/ given he'd be working with 80GB and growing database so for optimal memory requirements he'd need a db.r5.4xlarge instance with 8 cpus and 16 virtual cpus and 128GB of memory with the cost of a single Multiple AZ MariaDB server instance with 100GB of Provisioned IOP (1000) storage would be:
  76.  
  77. 1 instances x 3.84 USD x 730 hours in month = 2,803.20 USD (monthly onDemand cost)
  78. Amazon RDS MariaDB onDemand instances cost (monthly): 2,803.20 USD
  79.  
  80. 100 GB per month x 0.25 USD x 1 instances = 25.00 USD (EBS Storage Cost)
  81. 1,000 Provisioned IOPS x 0.20 USD x 1 instances = 200.00 USD (EBS IOPS Cost)
  82. 25.00 USD + 200.00 USD = 225.00 USD
  83. Storage pricing (monthly): 225.00 USD
  84.  
  85. Amazon RDS for MariaDB estimate
  86. Amazon RDS MariaDB reserved instances cost (monthly) 0.00 USD
  87. Amazon RDS MariaDB onDemand instances cost (monthly) 2,803.20 USD
  88. Storage pricing (monthly) 225.00 USD
  89.  
  90. Total monthly cost: 3,028.20 USD
  91.  
  92. Add 2 additional read replicas and that's 3x 3,028.20 if my maths are correct = US$ 9,084.60 per month or US$109K per year !
  93.  
  94. You could pay 1yr reserved instances for discount so it becomes US$1,843.85 per server per month or for 2 additional read replicas = 3x1843.85 = US$5,531.55 per month or US$66K per year!
  95.  
  96. Amazon RDS for MariaDB estimate
  97. Storage pricing (monthly) 225.00 USD
  98. Amazon RDS MariaDB reserved instances cost (monthly) 1,618.85 USD
  99. Amazon RDS MariaDB onDemand instances cost (monthly) 0.00 USD
  100. Total monthly cost: 1,843.85 USD
  101.  
  102. If he needed more provisioned IOP at 2000 would cost for storage
  103.  
  104. 100 GB per month x 0.25 USD x 1 instances = 25.00 USD (EBS Storage Cost)
  105. 2,000 Provisioned IOPS x 0.20 USD x 1 instances = 400.00 USD (EBS IOPS Cost)
  106. 25.00 USD + 400.00 USD = 425.00 USD
  107. Storage pricing (monthly): 425.00 USD
  108.  
  109. For 5000 IOP would cost for storage
  110.  
  111. 100 GB per month x 0.25 USD x 1 instances = 25.00 USD (EBS Storage Cost)
  112. 5,000 Provisioned IOPS x 0.20 USD x 1 instances = 1,000.00 USD (EBS IOPS Cost)
  113. 25.00 USD + 1,000.00 USD = 1,025.00 USD
  114. Storage pricing (monthly): 1,025.00 USD
  115.  
  116. $5.5K to $9K per month is probably too high a price for most forum operators unless you're income from forums far exceeds that. For that price bare metal dedicated server(s) in load balanced/replicated/cluster probably be much cheaper and performant if configured optimally - especially in current climate where you can rent monster servers for relatively much cheaper prices
  117.  
  118. Replication or clustering question = Read up on limitations and gotcha's for both for your SQL work loads first and then choose whichever you understand better as technology is only as good as the person using/configuring it
  119.  
  120. If you don't know the tech, then you can inadvertently introduce user errors/configurations which defeat the purpose of higher availability and better performance. For instance, I've seen end users of mine mess with my Centmin Mod stack's MariaDB MySQL auto tuned optimized settings created at initial install time which are based on detected server hardware configs /resources and see their performance drop by up to 60-90% until they reverted their changes !
  121.  
  122. Also what forum software is it ? vBulletin, Xenforo, Invision ? I only have experience with vB and Xenforo scaling forums to 60,000+ concurrent users with largest forums online in the past 15+ yrs. My Centmin Mod LEMP stack also powers at least 10% of the largest Xenforo forums online these days too - including Alex Top 10,000 sites
  123. The idea is not only scaling but also High Availability so even if i can handle many concurrent users with a beast sever i would like to have also HA...
  124.  
  125. Amazon costs are by far not for me at the moment....
  126.  
  127. I just need to decide if i will go with Replica - (Master-Slave) or Clustering - (Master-Master).
  128. Well, that comes down to your definition of high availability and how much functionality you want to lose during a downed master. If you want everything to work all the time, then you need master+master replication (clustering as you call it) of the database and replication of the web files in one way or other. With just master+slave, if the master goes down you, the forum will be in read only basically until you either promote a slave to a master or the master comes back up .
  129. -Steven | u2-web@Cooini, LLC - Business Shared Hosting | Isolate sites with Webspaces | Site Builder | PHP-FPM | MariaDB
  130. WHMCS Modules: Staff Knowledgebase | Custom Modules and Hooks
  131. "It is the mark of an educated mind to be able to entertain a thought without accepting it" -Aristotle
Advertisement
Add Comment
Please, Sign In to add comment