Multiple servers?

Discussion in 'Site & Server Administration' started by frisby, Jul 6, 2006.

  1. #1
    Hi!

    I want to know, how this works, if for one site you have more than one server. I plan to build site, which can break limits of one server in a month, so I must be prepared.

    So, how is it with this? On which server are files, database etc. For database I think is it smart to have separated server. But what if file server is overloaded?

    Thanks for any help in advance. Have a nice day.
     
    frisby, Jul 6, 2006 IP
  2. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What the heck are you running that can't run on one server? Are you speculating?

    If you've got a site that big, you really need better advice than you're likely to get here. However, file serving is not a big job; database stuff can tend to be. So in many cases what people do is put the database on a seperate server and the front end and file serving on the second. Then the front end just makes queries to the back end database server. I don't believe this is a very difficult setup to do (at least I think it's straightforward with MySQL).

    But for me, I'd just buy a bigger, badasses server.
     
    wheel, Jul 6, 2006 IP
  3. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Hm... Till now it is just speculating.

    My main problem is if the bandwith possibilities of server won't be enough, so there must be multiple servers. So there must be X servers in front with high bandwith capabilities which are connected to the base and common file server?

    Yes, there are really lot of things about that, like which server will serve depended on if others are overloaded etc...

    I didn't get it what do you think with that...
     
    frisby, Jul 6, 2006 IP
  4. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Given what you said, I would not go with more servers - just get more bandwidth. I think you'd be surprised at how much bandwidth a single server can handle. I have to throttle my server back so that it doesn't consumer to much bandwidth. Even throttled back it can do 500+gigs per day. Wide open, well goodness knows how much it could handle.

    Sorry for the improper english. What I meant by 'badassed' was a heavy duty server; like a server with 4 xeon processors, 20gigs of ram, multiple scsi drives, etc. Something like that would handle an awful lot of stuff.

    But again, from what you've described, I don't think you don't need more servers. You need more bandwidth. Far easier to get more bandwidth than to start splitting stuff across servers.

    (To look at it another way, even a low end server can handle enormous amounts of bandwidth - likely a lot more than you think. I've had a forum with mysql calls and everything (reasonably heavy load) handle as high as 50 requests a second and a gig of ram. At that point I had to move from a celeron to a P4 2.8 machine to handle that volume. That's what I mean - older slower machines will handle a huge amount of traffic).
     
    wheel, Jul 7, 2006 IP
  5. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #5
    Thanks for your opinion.

    This is really very powerful server. What link (gigabits) are connected to server mostly for that kind of server.

    Because for server with 100 megabit link, there may be a problem when on site is 500 - 1000 (depend on server) users in last 5 minutes (for example as i experienced on two other sites (not mine sites)).

    Have a nice day.
     
    frisby, Jul 7, 2006 IP
  6. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You need to distinguish what you're doing and how it's affecting the server. What you've just described IMO has nothing to do with the server. It sounds like you're likely serving up large files.

    1000 users in five minutes (I'm assuming by this you mean 1000 pages). That works out to 3 pages per second. And I'll further assume that's peak traffic. Just about any normal web server (i.e. not high end at all) should be able to handle that load without much effort.

    That means you've got one of two things going on. Either each of those users is running really heavy loads on the server (and if it's a standard website not doing something heavy computationally, then this is NOT the case) or you're serving up large files. If you're serving up heavy calculations, well, you already know that you've got larger server requirements. But more likely I'm guessing that in fact your webserver is basically sitting idle, but your internet feed is full. Quite likely a bigger internet connection will solve your problem, and I expect that your current webserver will handle the increased load. It's like trying to drain a huge water tank through a small hose. The water tank (your server) can easily drain faster, but you need a bigger hose (internet connection). Then your server can then fill this bigger hose.

    Of course, none of that is for sure - it's just been my general experience. The only way to tell for sure is to monitor your server and see what kinds of loads it's under and what types of files it's serving.

    If you're running linux, the two best commands for finding out what's server load looks like are:
    top (shows you in order the processes using the most CPU cycles, and also shows you how much overall the CPU is being used. Typical webserver would be running at like 0.2% to 2%)
    ps aux (shows all the current processes. Lets you look at what's going on - how many apache threads, how many mysql threads, and so on)

    On the off chance that the server is actually under load and it's not your internet connection, sometimes just a faster CPU can help. Or more ram. Or in many cases, just tweaking your programs so that they use less mysql queries can help an awful lot.

    Oh yeah, an advertised 100mbs connection may not actually mean you're getting 100mbs.
     
    wheel, Jul 7, 2006 IP
  7. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #7
    Hi.

    Good explanations. Thanks.

    I know there is many things to do to optimize this, there is site and server optimization.

    Lets do a small calculation.
    There are 1000 active users on site. That means averagely every minute one user visit 3 pages, this is 3000 pages per minute, this is 50 pages per second. And for example, if the average page is 200kb this mean that you need for 1000 active users bandwith in size of 100mbit. Agree?

    If there are more users, the server can easily became overloaded IMO.

    Don't you think the same?

    Greetings.
     
    frisby, Jul 7, 2006 IP
  8. wheel

    wheel Peon

    Messages:
    477
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You're math is OK (not that I checked), but I've had a forum with the numbers you've just described and it didn't use a 100mbit line. Didn't even fill a 10mbit line. Yes, at taht point the server was seriously lagging, but an upgrade to a 'reasonable' webserver fixed that - 3-4 gigs of ram, dual opteron, in that range. (remember, a lot of the stuff on the page is cached). And in fact, just switching forum software fixed the problem of the server lagging under that type of load.

    The rough math is fine for getting an idea of what you'll need. But for specifics, you'll need to actually monitor the server. If you're running file serving, you'll have different requirements than if you're running a busy forum.

    The way to do this is to get into it. Once you're running, you'll be able to tell from the server where the problems are likely to occur. Then you can tweak based on experience - and from there decide if you need a bigger server and how big. I wouldn't just jump into a huge server based on hoped-for traffic :).
     
    wheel, Jul 8, 2006 IP
  9. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #9
    Me either, but in plan must also be overloaded server.

    No, I'm not talking about file serving...

    Thanks for your help. :)
     
    frisby, Jul 8, 2006 IP