Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
MartinIAm

Load balancing with Ruby on Rails

Recommended Posts

Posted · Original PosterOP

I want to scale my Ruby on Rails projects and use a load balancer in front of it but I’m not really sure how to do this. How will I configure storage for this and scaling across multiple virtual machines? I use puma right now because it is multithreaded and can be used in a cluster, but I’m not sure how to setup the cluster.


Pegasides Server:

Dell r620

2x Intel E5-2630 6 core

4x 16gb ECC 1333mhz

2x Dell 15k 146gb

4x Lenovo HGST Ultrastar SSD1600MR 250gb

1x Solarflare 2 port 10gbe SFP+

 

Phoenix Server:

Dell r610

2x Intel x5650 6 core

12x 4gb ECC 1333mhz

2x Dell 15k 146gb

2x Samsung Evo 850 250gb

1x Solarflare 2 port 10gbe SFP+

 

Link to post
Share on other sites

i had done this for my cloud. The trick is to sprung up more processes, use a message queues, use cache, shard your databases, then rinse and repeat across as many server machines as you need to. To make this process less tedious, consider using docker, kubernetes, and automation tools like ansible. 


Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites
Posted · Original PosterOP
3 minutes ago, wasab said:

i had done this for my cloud. The trick is to sprung up more processes, use a message queues, use cache, shard your databases, then rinse and repeat across as many server machines as you need to. To make this process less tedious, consider using docker, kubernetes, and automation tools like ansible. 

I don’t run it off the cloud as I am self hosted so kubernetes and ansible isn’t a viable option for me but docker does sound like an option. 

 

You also didn’t explain how you manage your storage across the multiples virtual machines.


Pegasides Server:

Dell r620

2x Intel E5-2630 6 core

4x 16gb ECC 1333mhz

2x Dell 15k 146gb

4x Lenovo HGST Ultrastar SSD1600MR 250gb

1x Solarflare 2 port 10gbe SFP+

 

Phoenix Server:

Dell r610

2x Intel x5650 6 core

12x 4gb ECC 1333mhz

2x Dell 15k 146gb

2x Samsung Evo 850 250gb

1x Solarflare 2 port 10gbe SFP+

 

Link to post
Share on other sites
2 minutes ago, MartinIAm said:

I don’t run it off the cloud as I am self hosted so kubernetes and ansible isn’t a viable option for me but docker does sound like an option. 

 

You also didn’t explain how you manage your storage across the multiples virtual machines.

For storage, i used mongodb and shard them as i said earlier. It is the industry practice for scaling out. 

https://docs.mongodb.com/manual/sharding/


Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites

Lol mongodb :D 

 

For storage across multiple machines I suggest you get GlusterFS running, which is pretty straightforward and well documented across the interwebs. If you need Object storage ontop of this you can set up minio ontop of this, which is a 5 minute job as well.

 

If the project is tiny you can go with docker swarm. Not sure how long docker will hold up since their cash cow, docker enterprise, was bought off. And in the K8s space everyone and their mom went with different components instead, even RH with their Openshift.

Link to post
Share on other sites
Posted · Original PosterOP
17 hours ago, wasab said:

For storage, i used mongodb and shard them as i said earlier. It is the industry practice for scaling out. 

https://docs.mongodb.com/manual/sharding/

I didn't know you could use mongodb for storage.


Pegasides Server:

Dell r620

2x Intel E5-2630 6 core

4x 16gb ECC 1333mhz

2x Dell 15k 146gb

4x Lenovo HGST Ultrastar SSD1600MR 250gb

1x Solarflare 2 port 10gbe SFP+

 

Phoenix Server:

Dell r610

2x Intel x5650 6 core

12x 4gb ECC 1333mhz

2x Dell 15k 146gb

2x Samsung Evo 850 250gb

1x Solarflare 2 port 10gbe SFP+

 

Link to post
Share on other sites
Posted · Original PosterOP

Oh! I think I understand now. So I can use mongodb as storage for active storage, and the use something like NFS to have the same replicated project across the multiple servers.


Pegasides Server:

Dell r620

2x Intel E5-2630 6 core

4x 16gb ECC 1333mhz

2x Dell 15k 146gb

4x Lenovo HGST Ultrastar SSD1600MR 250gb

1x Solarflare 2 port 10gbe SFP+

 

Phoenix Server:

Dell r610

2x Intel x5650 6 core

12x 4gb ECC 1333mhz

2x Dell 15k 146gb

2x Samsung Evo 850 250gb

1x Solarflare 2 port 10gbe SFP+

 

Link to post
Share on other sites
19 minutes ago, MartinIAm said:

I didn't know you could use mongodb for storage.

I used gridfs on Mongo. Idk if this is the ideal way to store large files but hey, it works well enough for me. 


Sudo make me a sandwich 

 

Check out my guide on creating your own private cloud storage

 

Link to post
Share on other sites
Posted · Original PosterOP
On 1/29/2020 at 4:17 PM, wasab said:

I used gridfs on Mongo. Idk if this is the ideal way to store large files but hey, it works well enough for me. 

Just to confirm, do you use Mongo in config/storage.yml?


Pegasides Server:

Dell r620

2x Intel E5-2630 6 core

4x 16gb ECC 1333mhz

2x Dell 15k 146gb

4x Lenovo HGST Ultrastar SSD1600MR 250gb

1x Solarflare 2 port 10gbe SFP+

 

Phoenix Server:

Dell r610

2x Intel x5650 6 core

12x 4gb ECC 1333mhz

2x Dell 15k 146gb

2x Samsung Evo 850 250gb

1x Solarflare 2 port 10gbe SFP+

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×