LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-22-2018, 09:59 AM   #1
cilbuper
Member
 
Registered: Mar 2008
Posts: 141

Rep: Reputation: 0
Web server load balancing during high demand - linking to outside server?


I am wondering if it is possible to set up a server either somewhere in the network mounts or even vhosts, where when demand is really high on the server, it can send all the requests for folder /www/site/pics and /www/site/video to an off-site server/host where these files are also located. So when the server load gets to a certain point, it redirects all calls for the local /pics and /video files to an external host to have that host send the files to the client.

I'm wondering if this can be done through the server or if it has to be done in the website coding (I'm not sure how it would be done in the coding, but I would think it would be possible..?).
 
Old 01-22-2018, 04:08 PM   #2
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 136

Rep: Reputation: 18
What you are asking for is not simple, especially the way you're asking it makes me believe you are not experienced in server admin. If you want to know more the 2 best approaches imo are using nginx or HAProxy.

nginx:
http://nginx.org/en/docs/http/load_balancing.html

haproxy:
https://www.digitalocean.com/communi...ncing-concepts

Of course it would be possible to roll your own custom solution but that is never a good idea. Existing solutions might look complicated but they are robust and well documented.
 
Old 01-24-2018, 03:34 AM   #3
sbaynes
LQ Newbie
 
Registered: Oct 2014
Posts: 28

Rep: Reputation: Disabled
Most webservers can pick up different URL paths from different places on the filesystem.

To collect certain paths from another webserver requires reverse proxy functionality. nginx has this built in, apache has a loadable module to do it.
Or you can use a dedicated reverse proxy to front up you website and direct requests to other servers according to the path or other information in the request. There are plenty of good ones out there. This is a common setup for high performance web sites.
 
Old 01-26-2018, 08:11 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,636
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Several easy things to check:
  1. Make sure that "static-file content" is being served directly by Apache, not sent through your application.
  2. Determine how many requests your server can handle at once, and set web-server limits so that no more than this number of workers are ever launched. (The other requests must wait their turn.)
  3. Some cloud hosting services provide "near-instantaneous scale-up capability." (You pay more, of course, for the extra capacity, which is magically furnished on-demand.) These use "Linux container" and maybe "application server" strategies.
  4. Consider using efficient technologies like FastCGI, which can distribute the work of generating web-page content to a phalanx of back-end servers, while keeping the actual server worker-bees "small, light and fast" as they should be.
  5. Don't design web apps that attempt to do "expensive things," like generating reports, directly in the page. Build or steal a "work-queue manager" which lets you queue up the request for processing by a back-end daemon, with the means for the requesting user to periodically check its progress and then to retrieve results.

Last edited by sundialsvcs; 01-26-2018 at 08:14 AM.
 
Old 08-02-2019, 02:57 AM   #5
DaniellaFraire
LQ Newbie
 
Registered: Aug 2019
Posts: 1

Rep: Reputation: Disabled
Go for cloud hosting

You better go for the Cloud hosting for your web server in the first place. You see in this manner your website is hosted on multiple servers and at the peak times your load could be distributed among the different server. Thus, resulting you an awesome up-time of your website.
Considering your thread @cilbuper. I can assume that you are not that much technical in the server and all. So, I suggest you to go with google cloud web server which is managed by Cloudways. As, it takes away all the pain of managing the server by letting you a simple and easy platform to deal with.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Web Server Load-Balancing with HAProxy on Ubuntu 14.04 LXer Syndicated Linux News 0 03-25-2015 07:15 PM
[Solved] High load web server imadsani Linux - Server 5 03-04-2014 12:43 PM
Web Server Load Balancing using ldirectord and Apache romeo_tango Linux - Server 1 02-17-2010 03:46 AM
Load Balancing With 2 ISP on LAN (problem with web site on the Server) smadon Linux - Networking 1 08-21-2008 01:58 AM
i need help for load balancing setting apache web server gnu_gcc Linux - Server 2 06-23-2008 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration