Koozali.org: home of the SME Server

HAProxy

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
HAProxy
« on: February 20, 2019, 06:07:47 PM »
I have an SME 9 server that is pretty heavily loaded. There are a couple of web services that consume vast amounts of CPU resources. The cpu is an Intel Core(TM) i3-4130 CPU @ 3.40GHz, which I believe is a four core system.

A colleague suggested I look into HAProxy. http://www.haproxy.org/

Comments, anecdotes, and tales of experience, are most welcome.

- Mark

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: HAProxy
« Reply #1 on: February 21, 2019, 10:15:56 PM »
In the depths of time, he who shall remain nameless did some work on this.

See reference here and I remember discussions about it though I have no idea if any of the code is kicking about. Have a look in bugzilla.

https://wiki.contribs.org/SME_Server_wishlist#Nice_to_have

Seems to be supported:

http://www.haproxy.org/#plat


First question is what are you actually trying to achieve?

You'd need a load balancer, and extra hardware. Might be easier just to upgrade your server to something with more grunt?

Have you analysed what is causing the high usage and if there is anything else you can do about it?

I believe you can also do some HA stuff with Proxmox too - worth a look as well if you are going to go and splash some cash.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Mophilly

  • *
  • 384
  • +0/-0
    • Mophilly
Re: HAProxy
« Reply #2 on: February 22, 2019, 01:22:02 AM »
First question is what are you actually trying to achieve?

 [snip]
Have you analysed what is causing the high usage and if there is anything else you can do about it?

First answer: Life without stress! After that, an average load around 60% capacity. We see average loads ranging from 1.2 to 5.2. On a four core machine I assume a load value of 2.5 is close enough to the 60% goal.

Second answer: just starting to research the problem(s) and the options.

There are several apps that work in concert and share database resources. The apps involve postgres 9.5, python 2.7, and PHP 7(dot what day is it?), along with standard stuff like apache.

Postgres appears to be pretty well behaved. The app written in python is saddled with GIL and is being reworked to use Apache with mod_wsgi, which will help when it is ready. PHP is still oblique to me at the moment. So I have work to learn more about these.

Other options like increasing RAM, launching multiple python instances, and a look at hardware, like adding another server are on the list.

I know enough to know I don't know enough. Comments are welcome.
- Mark