Slashdot Mirror


Building/Testing of a High Traffic Infrastructure?

New Breeze asks: "I'm currently working on my first web 'application', and have discovered that I know less than nothing about setting up the infrastructure to manage a high traffic system. Where does one go to learn about setting up the infrastructure required to host something like Slashdot? Or do you just say, 'Not my area!' and help them find a consultant?" "My experience is pretty much limited to:
1. Install the web server on one box, the database on the same box if it's a small installation or a separate box if performance seems like it will need it. Add more memory and processors based on SWAG criteria. (Scientific Wild Ass Guess)

2. Contract with a hosting company.
I had a potential customer ask what I would recommend if they wanted to self host, they have around 300 remote locations and would have multiple users from each location hitting the application at the same time, so saying a couple of beefy servers probably isn't the right answer.

I haven't a clue. The last place I worked with on something like this hired a high dollar consultant who spend a huge pile of their money setting up a load balanced, oracle parallel server redundant everything system.

How do you test it? I've worked where they actually had a room with hundreds of systems on racks that they would configured to run test transactions against different servers and software builds for stress testing, but that's not in my budget..."

59 of 231 comments (clear)

  1. A Beowolf Cluster of Course by l810c · · Score: 4, Funny

    That one was easy, ...Next

  2. Ask a Pr0n serving company by chia_monkey · · Score: 5, Insightful

    Seriously...they know all about serving up content on high traffic sites. Not only is it high traffic, but it's rather big files that they're delivering. When we're testing the networks that we set up, both wired and wireless, we often visit pr0n sites for our benchmarks.

    --

    "He uses statistics as a drunken man uses lampposts...for support rather than illumination." - Andrew Lang
    1. Re:Ask a Pr0n serving company by AndroidCat · · Score: 4, Funny

      Okay, let's put it to a real test. Post some good pr0n links and we'll try to slashdot them!

      --
      One line blog. I hear that they're called Twitters now.
    2. Re:Ask a Pr0n serving company by Neil+Blender · · Score: 5, Informative

      Okay, let's put it to a real test. Post some good pr0n links and we'll try to slashdot them!

      Having worked for porn sites, I will tell you this: They, more than anybody, will rise to the challenge. Porn = Traffic = Ad Click Throughs = Money. If a porn site sees a sudden rise in traffic, they will drop more servers into their delicately load balanced system without blinking an eye. Porns sites aren't slow. There is a reason why.

    3. Re:Ask a Pr0n serving company by DogDude · · Score: 4, Interesting

      Absolutely. Most companies hand the whole thing off to a hosting companies that specialize in porn hosting. These places are rooms upon rooms of racks, on raised floors, 6 times redundant connections, dual power backup systems (generators), and all the fiber you could ever want. They're the best. Take a look Candid Hosting. They had a few hurricanes go over them, and they didn't bat en eye. Incredible uptime.

      --
      I don't respond to AC's.
    4. Re:Ask a Pr0n serving company by emmetropia · · Score: 2, Informative

      I've done the porn gig for a while, and I can tell you a "secret" that won't work all that well for a web application. Anything on a porn site that can be served up statically, usually is. If it's a "page of the week" it usually is generated once a week, so that you don't need to pull from the database on every single hit. At least, that's they way it works/worked for us.

      If you do need to hit the database with almost every page load, there's a few simple tricks. These are what I use with PHP, which is the only language we use on our sites. If there's common information that will be called upon a lot, store it in a session variable, as it saves database transactions (not much, but every bit counts). Take a look at how you're database transactions are setup. If you have a table with 30 columns, and you only need 8, then select those 8 instead of *. If there's a lot of traffic on a particular page, try persistent connections. Look at an object oriented way of writing all of your db transactions, makes big applications a little smaller and easier to work with, and if you find a way to fix something you're doing it, just fix the class instead of every script in the application. There's plenty of other little "tricks" and what i've said doesn't really qualify as tricks, but there's plenty you can do before you start talking multiple load balanced servers.

    5. Re:Ask a Pr0n serving company by Barryke · · Score: 2, Insightful

      Candid Hosting is expensive, at least in comparision to dutch hosting (Amsterdam Internet Exchange)

      --
      Hivemind harvest in progress..
  3. Post a URL by MarkusQ · · Score: 5, Funny

    Post a URL here and we'll help.

    -- MarkusQ

    P.S. Clever use of the text describing the link may help you control how much trafic you get, from low ("M. Moore Nude!") to high ("SCO caught robbing courthouse").

  4. Simple Flow chart for learning by drachenfyre · · Score: 5, Funny

    1. Submit Link to slashdot with your webserver hosting a lot of large video files supporting the link.
    2. Have link approved (Note - duplicate any story just posted is probably the best way to get approval and lots of people crying dupe)
    3. Learn what caused the webserver to melt and how long it took to melt.
    4. Fix the problem that caused step #3
    5. Repeat 1-4 until server doesn't melt.
    6. Congrats! You've learned how to host a high demand web server.

  5. Test using Slashdot itself! by xmas2003 · · Score: 2, Insightful
    In answer to your question about testing, have your web site /.'ed and see how it handles the Slashdot Effect which is a pretty good stress test! ;-)

    P.S. When I first tried to read this story, I got "Nothing for you to see here. Please move along" ... somewhat ironic I'd say ...

    --
    Hulk SMASH Celiac Disease
  6. Re:weekend gmail invites by Japong · · Score: 3, Informative

    These are very obvious links to a shock site, ignore them and mod parent down. Seriously, AC, don't you get tired of this?

  7. hmm by Anonymous Coward · · Score: 2, Informative

    it really depends on what you need.

    In my experience though hardware (especially memory) and bandwidth come before a superoptimized software front-end & database.

    A good introduction I can recommend is called "Developing IP-Based Services: Solutions for Service Providers and Vendors" - I forget who wrote it. But definatly worth reading on the subject.

  8. PLEASE by asadodetira · · Score: 5, Funny

    Please don't tell him. We don't need another slashdot. Servers worlwide surrender

    OK.It's easy. There are three steps involved
    1.Build a low performance infrastructure.
    2.Put a RT sticker and chromed exhaust pipes
    3.Done

  9. Do the math by MarkusQ · · Score: 5, Insightful

    First step, do the math.

    What was once a "high volume" app may be nothing for modern equipment. You're talking about on the order of 1K concurrent users (300 sites * several users per site).

    If "use" means manually typing data into forms, viewing mostly static pages, etc. this isn't really a very "high volume" application, and a single decent server should handle it.

    If, on the other hand, "use" means constantly running complex queries against a billion item data set, you're doomed.

    So where do you fall in this spectrum?

    Coming up next...where's the bottleneck?

    -- MarkusQ

    1. Re:Do the math by New+Breeze · · Score: 4, Informative

      300 sites, between 12 and 200 concurrent users at a site.

      It's a CRM system, i.e. some basic data entry, some portions are transaction processing. i.e. the workflow portion for the base part of the app is very simply:

      Search for customer by various criteria.
      No customer found, add one.
      Retrieve customer information.
      Add current order information being stored for this customer.
      Process loyalty/discount programs to see if customer qualifies for an award.
      Return award to order entry system for processing.

      There's a lot more to it, but that's the meat of it. It's fairly data intensive, there is a great deal of information stored for customers for use in data mining the collected information. It's primarly web service based, but there is a fairly extensive management and reporting tool that is all HTML based.

      My guess is going to be that the bottleneck is going to the the database, but we've done extensive testing with a million customer sample database running multiple instances of test applications from 10 other boxes, but that doesn't exactly prove much as it's too predictable.

    2. Re:Do the math by mrjohnson · · Score: 3, Informative

      Aight, I'll take a stab...

      You'll need a hardware SSL loadbalancer, with redundancy:

      http://www.coyotepoint.com/e450.htm

      (Two of those).

      You'll need at lease two web servers with CPU and RAM. The requirements on these boxes really depend on the app. I'd make them dualies at least, with fast Xeon processors (Good bang for the buck). A couple gigs of ram each. You can add servers to the load balancer later if you need to. Disk doesn't really matter, but I'd use a SCSI mirrored root volume for reliability.

      The database needs to be redundant, and since you think it'll be the bottleneck, an Oracle RAC setup would seem to fit your needs. I really don't like Oracle from a developer stand-point, but two big servers with Oracle running on raw disks for performance is a tough combo to beat. Expensive and long on the setup and install, though.

      With all of that, you'd have a large initial investment, but something that would grow with your needs. You could add new apps to this setup later on, as well. However, if you needed to run this on the cheap, the Linux Virtual Server project does a lot of this with simple Linux boxes.

      If this is too expensive, the first thing to take out is the hardware SSL. I included it because I want them, not because I have 'em. :-) Check out pound:

      http://www.apsis.ch/pound/

      A couple Linux boxes with failover setup and you've saved a good 40-70 grand. Requires some expertise.

  10. Apache Benchmark is your friend by sseremeth · · Score: 5, Informative

    If you want to throw some serious load at your equipment, get a few other systems saturating your network with Apache Benchmark (ab) requests. It gives lots of useful data, like response times, etc. . And you're best off toppling the application and trying to find the cause that it failed and working on that as someone already suggested. The rinse and repeat.

    Looks like Apache has updated their tools since the last time I had to do this...

    http://httpd.apache.org/test/

    1. Re:Apache Benchmark is your friend by oneishy · · Score: 2, Interesting

      Another really good tool for stress testing web apps is Microsofts Web Application Stress Tool. It allows you to configure testing for a set of different virtual users, and also supports https, stores cookies if you want, etc. An all round good featured tool. One of the best features for testing a load ballanced app is it's ability to seamlessly distribute the testing load across multiple client machines, thus really providing a realistic load.

  11. Look at the other high load websites by GrAfFiT · · Score: 4, Informative

    Check out what those guys do at Wikipedia. Don't forget to look at their useful links at the bottom.
    Or maybe it's overkill.

  12. Dear Slashdot... by Anonymous Coward · · Score: 5, Insightful

    I'm currently working cooking in a restaurant, and have discovered that I know less than nothing about performing stomach surgery. Where does one go to learn about the techniques and tools necessary for curing stomach cancer? Or do you just say, 'Not my area!' and help them find an oncologist?

    Seriously.. you have a lot to learn, and a lot of what you need to know just comes from experience which you can't get from a book.

    First: learn how everything works. When you click a link in your "application" (why the quotes?), what happens? For instance, does it run a Controller object? If you're using a language like Ruby or Perl, is it "pre-compiled" or does it have to interpret a script on each hit? Does the controller then go to the database and populate variables, then insert them into a template, then render the template? Is the template cached? How are your database settings? Enough memory for joins? Are all your queries using the appropriate indexes? Are you familiar with your database's performance-measuring variables and tools? Are you pulling more data than you need to in each query?

    Once you have an understanding of what's happening, then you can start measuring. Where are the bottlenecks? This is a very important thing to keep in mind in programming or system architecture: DON'T OPTIMIZE UNLESS YOU NEED TO! Keep your system and code as simple as possible. For instance don't cache things in your program (making it more complicated and harder to maintain) unless you have a BENCHMARK IN HAND showing a performance bottleneck.

    You might not need to move your database to another machine. What you need to do depends on your app.

    Yes, you will need to do a lot of testing to identify your "first round" of bottlenecks. You need to build a lot of diagnostics into your app to help you identify how long different steps take.

    Always deploy your app in stages, one site at a time, until you start identifying some problems. Then fix those problems before continuing deployment. Never "flip a switch" and reveal any change all at once.

    Good luck!

    1. Re:Dear Slashdot... by New+Breeze · · Score: 2, Informative

      I think there was a misunderstanding. I know how the application works in great detail. I know that it can be scaled up across multiple machines. It will scale up.

      What I don't know is how to judge what hardware to reccomend to someone wanting to self host.

      I'm pretty damn sure that only comes from 1) Testing, and I'm not buying $10's of thousands in hardware to test with and 2) Experience, which I don't have.

      The last place I worked at had a rack of nice quad zeon processor systems in their lab that they had to take back from a customer when they didn't withstand the onslaught. I'm leaning towards letting a consultant roll the dice, because I 'd lose my shirt if that happened.

  13. How to do it with little/no budget by multipartmixed · · Score: 5, Informative

    First off, if this is a "must succeed with no problems" project, all bets are off -- hire an experienced consultant so you have someone to blame. Also, this technique only works when you have the type of site which will *build up* to expected load -- not get turned on instantly.

    This is tough to generalize without knowing specifics, but here goes:

    1. Make sure your application can work correctly when load balanced across multiple boxes
    2. Keep webserving and DB work on different machines
    3. Make sure your application can work with another database without much work (this gives you the option to hire, say, an Oracle DBA and buy an Oracle license if MySQL can't keep up.. does it even support row-locking yet?)
    4. Have extra hardware handy, in the rack. Do NOT turn it on yet.
    5. Observe the application running; determine bottlenecks, tune
    6. If you can't tune it to perform adequately, NOW is the time to break out the extra hardware while re-evaluating the implementation.

    If you throw all your hardware at the problem at once, you get very little warning when the shit starts to hit the fan, and no response scenario. Do NOT make that mistake. Load, test, tune, repair, repeat.

    --

    Do daemons dream of electric sleep()?
    1. Re:How to do it with little/no budget by coofercat · · Score: 2, Interesting

      In my experience (having played at being the highly paid consultant who comes in to fix stuff once you've messed it up) I'd always point the finger at the linkage between components ("components" being items in your architecture, including the people you're using to help you). In a three tier environment (a sensible approach, almost regardless of your technology), the database is often a problem. DBAs jump on that pretty quickly, so what's left? Networks are normally easily sorted, but you may still find your application idles when you expect it to be returning pages faster. Here the linkage plays a part. It's the linkage between the parts (not necessarily the connectivity though) that'll be the issue. Failing that, make code changes to your application. I haven't seen an application yet that didn't benefit from lots of code tweaking to make it more efficient, use the DB better, generate better SQL, less SQL or what ever. Either way, the OpenSTA route (or LoadRunner if you can afford it) is the only way to do testing. Setting up the tool is a job in itself, and very worth doing carefully (after all, making a virtual user overly aggressive makes it harder to meet targets, but too weak and your system doesn't do what you say it will). As for all the posts about redundancy, load balancing etc - all good information, and something you will need if you need something like 100% uptime. That said, I know of a bank that ran a system supporting hundreds of concurrent users with a single line of three sun boxes (+ mainframe) - they got their uptime targets, and at a fraction of the cost of their rivals who have two of everything, and then duplicate that in two buildings (but can't run it for toffee).

  14. Interesting.... by killerasp · · Score: 2, Interesting

    this is a very interesting topic. I just just started my new job where i was coming from an internship previously. There we had a web server, database server, a devbox and a log processing box for webtrends analysis. But now at my new job im being introduced to high level PIX boxes, F5 load balancers, redudant web servers, transaction servers, etc. One thing i just learned the other day is that they use the F5 to handle SSL encryption/decryption instead of relying on the webservers. I never knew that was possible. But eventually i want be able to do all that my boss does right now. Anything less is less than perfection...MUAHAHA.

  15. Two scenarios: by Jerf · · Score: 4, Insightful

    1: Gradual growth. Find bottleneck, remove it. Repeat. Make sure to start with a growable database and web site technology, but that shouldn't be too tough. Also, stay ahead of the game, always with overcapacity, both to cover for outages and for sudden growth spurts.

    2: Instant growth from 0 to thousands+: Hire someone who knows what they are doing. In the first scenario, you have the time to learn what is actually going on, which is an advantage. In this one, you don't, and the customer base is to big (i.e., $$$) to screw with.

    That basically covers it. Specific advice will vary widely based on databases and web technology deployed, so just about any other specific advice you get here is as likely to be wrong for you as right.

  16. no. 1 cause of downtime by morten+poulsen · · Score: 2, Interesting

    I run a site which peaks above 5,000 page views/second. That part is static, and runs thttpd. No problems at all.

    The other part is dynamic. It runs on Apache (load balanced, no problem) with a PostgreSQL server. If you don't need it's features, "just say no"!

    It is the single part in our system that causes most problems. When your tables grow semi-large (less than 800k rows) and you do a few joins, it chooses strange - and slooooow - ways to execute your queries. Combine that with a few journalists who wants to insert and update articles, and you have a sysadms worst nightmare.

  17. Depends by JediTrainer · · Score: 3, Insightful

    What constitutes 'high traffic' for you?

    I've been developing a high traffic site (well, maybe medium traffic) at about 1.5 million transactions per month. We have customers using the site all over North America, plus a few in Europe and Asia, and the whole thing is hosted internally off of our 10MB link.

    We have each 'tier' clustered as a pair of servers - 1Ghz/256M is more than sufficient for our 2 Apache servers. 3Ghz/1GB is our Tomcat tier, and I'm not sure what the DB runs on, but they're the beefiest servers of all the tiers.

    Within the app architecture, try to ensure that you can scale to more servers. We have the ability to add more servers to any of the above tiers without any changes, plus any long-running processes (complicated reports and such) get dispatched to a fourth layer of servers we call 'backend' (by RMI). These 'backend' servers can be low-end (300mhz/256M are fine), because they run non-time-critical tasks and generally might email their results or whatever.

    In this way, we've avoided the EJB complications while also having full redundancy at every level. There was some custom framework involved, but it's been working well. Our application was complex enough to warrant an advanced framework (similar to Struts, except we wrote ours before Struts came out), yet EJB seemed too heavy for what we wanted to accomplish. Of course it didn't hurt that the only thing we paid licenses for was the DB.

    Importantly, though, this was the right solution *for us*. It's serving us well, and already scaling well beyond the number of customers we originally anticipated would be using it. While this meets our needs fairly well, it may or may not be the right type of solution for what you're looking for, particularly because I don't know what your application is supposed to do.

    --

    You can accomplish anything you set your mind to. The impossible just takes a little longer.
  18. A few basic things... by Em+Ellel · · Score: 5, Informative

    These are some very basic thoughts on the subject. They may not be 100% right for you, but will get you thinking in the right way:

    Rule 1 - Three tier archictecture is popular for a reason - it works. Offload user interface (web) to dedicated boxes, make application itself run on separate boxes and make database separate

    Rule 2 - When possible, scale horizontaly not vertically. Make sure your application is as stateless as possible and is capable of you just dropping in an extra server when needed without a lot of reconfiguring. Make sure you can survive a loss of a server without loss of data. Lots of cheap servers will most always work out better (and cheaper) than one big ass box.

    Rule 3 - Make as much of your application as static as possible. Even pseudostatic data (something that updates every minute or so) should be made static and have a process re-generating it every minute or so. Not wasting your CPU time to render a menu or something on every hit will add up fast under heavy stress.

    Rule 4 - Strip your HTML. For example, some crappier web languages (think ColdFusion) have a tendancy of inserting spaces for every line of code etc. A large application running CF (dont ask) would insert enough spaces to make a simple page hundreds of kb in size. Just turning on "the write to output only on demand" option will drop size of the page to next to nothing. So know what it is that you are producing on output and make sure it is lean. Turning on server side compression solves this better, however adds to CPU requirements. On trully stateless web servers this just mean you need more web servers. So MAKE YOUR WEB SERVERS STATELESS.

    Rule 5 - Know how many users your upstream connection can handle (in simplest terms - average size of HTML communication * number of users) and make sure you do not exceed it. Limit your connectivity at load ballancer. Having some users not be able to access your site is better than having ALL users not be able to access your site. Make sure you get plenty of bandwidth to spare. If you are setting up a multi-site presence, make sure your intersite communication is a - not going over same line as incoming and b - has sufficient bandwith and latency to serve the traffic.

    Rule 6 - Professional load testing tools cost big bucks. But if you are carefull you can fake it with some open source software. Google it. When testing remember to take into consideration the limitation of your tester system and bandwidth.

    -Em

    --
    RelevantElephants: A Somatic WebComic...
  19. RE: Using F5's to encrypt data by Em+Ellel · · Score: 2, Informative

    It may or may not be a great idea depending on your situation. For one - the cost of SSL card for F5 is so high, it may be easier to just get extra servers. For another, I work with some banking applications and having data sent cleartext, even on an inside network directly connected to load balancers is NOT a valid option.

    However if local security can be ignored and you have the money to spend, F5's offer a nice offload of encryption processing. But then again, so do hardware cards for individual servers.

    -Em

    --
    RelevantElephants: A Somatic WebComic...
  20. high traffic system by psin+psycle · · Score: 2, Interesting

    I've worked on a very high traffic system. At one point we were pushing 100MBPS in traffic. I had about 15 servers, 1 database server, and a load balancer. The traffic was mostly static html pages, with a bit of php/mysql for about 1/10th of the traffic.

    We had a master database server that was distributed to all the webservers. When reading from the database, each webserver would read it's own local copy. mysql replication kept the data on the local webservers fresh.

    Updates to the database were easy as only a small number of users were doing any updates. All updates were able to go through one server and wrote directly to the master database.

    The load balancer was managed by the hosting company. It simply made sure that all the webservers shared the traffic load. Any webserver that died for whatever reason would automatically stop getting traffic sent to it.

    --
    Need a website host? Try out http://WebQualityHost.net
  21. Re:ahhh ask slashdot... by StillAnonymous · · Score: 2, Informative

    It's also a good opportunity for people to learn from other's experiences. Christ, man, I don't see why people have to hoard their knowledge. What kind of example does that set?

  22. Re:The obvious answer is: by gal1264 · · Score: 2, Interesting

    Everyone has to start somewhere right?

    What's your background. There's lots of different ways to solve every problem. I think it's much more of an assessment of what kind of problems you're good at solving. If you think you can conceptualize what your system needs to do, and evaluate different components objectively do it.

    Coming from someone who's implemented some massive testing infrastrucutres and custom tools, worked on computational biology frameworks, as well as well as currently working on fault tolerant scalable SIP based telephony systems and protocol development it's really just like any other massive project. Go incrementally and solve one problem at a time. If you're good with databases and know where they excel do it, otherwise use data structures. If you are strong with PERL and apache base it on linux(perhaps with MySQL), versus otherwise go to a bookstore, pick up books on a couple easy components and stick with what you're good at. I personally also recommend actually getting maintinence on open source products you're not incredibly familiar with as a little help goes a long way.

    So anyway, again, above all, go with what you're good at. If you give some more details perhaps people can make some more concrete recomendations.

  23. Test and define your usage by DeBaas · · Score: 2, Informative

    There is a reason why this is a specialty. There isn't a clear answer.

    The answer depends on many factors such as:
    - how heavy are the pages (many pictures?)
    - what's the platform (Lamp/J2EE/etc....)
    - how is the usage?, if someone gives you a figure for concurrent users, ask yourself what they mean by that. Some apps have users contstantly submitting, others once in a few minutes
    - how are they connected? Reverse proxy can really help for slow connections!
    - if you have performance problems, investigate where the pain really is. Is it the (R)DBMS, or the app server, memory IO.
    - etc. etc.

    Most of all: test! Get something like grinder, or opensta and put some serious load and stress on the setup. See where it hurts.
    Make sure that if you have a problem, you actually fix the right problem. It is ok to add hardware, but you have to know what hardware to get.
    Also many problems can be handled by configuration, such as preventing the system to come to crashing halt by limiting the amount of connections to the amount you can handle.

    Look overhere Perl strategy doc It has some good advice that will help you also in non perl environments.

    --
    ---
  24. (File throughput) != (database connectivity) by turnstyle · · Score: 3, Informative
    Popular porn site likely do lots of bandwidth, but that doesn't necessarily mean lots of database hits.

    Accommodating "high traffic" that is mostly bandwidth intensive is quite a different problem than accommodating traffic that is database intensive.

    --
    Here's what I do: Bitty Browser & Andromeda
    1. Re:(File throughput) != (database connectivity) by LiquidCoooled · · Score: 2

      Don't most porn sites now run database backends to manage the linking and hit rates?
      Those that *ahem* list a "todays best" area at the top of the page, followed by the daily links are certainly DB driven.

      Theres management required for referrer chains and user management.
      Thats without even getting to the individual gallery/image/movie pages that are decorated with links and adverts depending on where they come from.
      I've even seen sites now with a blogger style entrance and backend tpg style archives.

      They are most certainly fully blown (pun intended?) Content Management Systems , and not just high bandwidth static servers.

      If all you ever see is static porn pages, your looking in the wrong place....

      --
      liqbase :: faster than paper
  25. Re:The obvious answer is: by twigles · · Score: 2, Informative

    Jesus what an asshole this parent poster is. Someone asks for advice and this arrogant guy calls them incompetent for not being born with the knowledge. Someone please mod him troll; this is exactly why non-techies think we're all arrogant.

  26. Can you qualify some of this stuff? by UVABlows · · Score: 2, Insightful

    I don't really understand a lot of the stuff you said (I am not a sysadmin). For example:

    What does it mean to not scale "vertically"? When I read that, the only thing that comes to mind is to put the boxes next to each other, not on top of each other. From context I gather that horizontally means extra machines, but what does vertically mean?

    For "dropping in an extra server when needed without a lot of reconfiguring", what do you mean by "a lot of reconfiguring"? Obviously you need to get the machine, install the os, set up networking, install the web server, setup the web application, point it at the database, etc. How does the application being "stateless" help? I guess, what are some examples of state that an application can have that will make configuring an additional web server difficult?

    Concerning the pseudo static data regeneration, what if the thing that was being updated was only accessed once every half-hour on average? I am assuming then that generating the page on demand would be better?

    I don't really know what you mean by "MAKE YOUR WEB SERVERS STATELESS". I mean, they have to know if a request just came in, where the data is, what time it is etc, and that stuff gives it state. I am assuming you mean something else by stateless but I cannot figure it out.

    Thanks for the help!

    --

    <high-level position here>
    <name of stupid small company here>

    1. Re:Can you qualify some of this stuff? by Em+Ellel · · Score: 3, Informative

      What does it mean to not scale "vertically"? When I read that, the only thing that comes to mind is to put the boxes next to each other, not on top of each other. From context I gather that horizontally means extra machines, but what does vertically mean?

      Horizontal scaling - adding more machine
      Vertical scaling - adding more CPU/Memory/etc to existing machines.

      For example, a horizontally scaled application may have 20 1u 1cpu servers, a vertically scaled one has a Sun E15k heating up the room.

      For "dropping in an extra server when needed without a lot of reconfiguring", what do you mean by "a lot of reconfiguring"? Obviously you need to get the machine, install the os, set up networking, install the web server, setup the web application, point it at the database, etc. How does the application being "stateless" help? I guess, what are some examples of state that an application can have that will make configuring an additional web server difficult?

      Reconfiguring the application not the servers. A stateless web server does not store any user state. Meaning that if a user hits web server A for one request, and web server B for another, the user will not know the difference. Also meaning that if you add another server, you do not need to worry about conflicts, sharing data, etc. Stateless servers can be taken offline or brought online without any fuss. They become a commodity appliance and if you need more, you just get more. In realistic terms this means that if you need state for the application (login, etc) you either store the state on the client's machine in a cookie (BAD, all sorts of abuse is possible) or better store an temporary ID in a cookie (or in URL) and store state in App server or (better) DB. A lot of web servers and app servers offer clustering to solve the state issue. While this may or may not work, most of the time it is a marketing hype that rarely lives up to expectations and add extra load. It also violates KISS principle (Keep It Simple Stupid) and will give you more headache than it is worth.

      Concerning the pseudo static data regeneration, what if the thing that was being updated was only accessed once every half-hour on average? I am assuming then that generating the page on demand would be better?

      Use your brain. The idea is to lower CPU requirement and potential risk from overloading, not just to use a cool trick. Do whatever works best.

      I don't really know what you mean by "MAKE YOUR WEB SERVERS STATELESS". I mean, they have to know if a request just came in, where the data is, what time it is etc, and that stuff gives it state. I am assuming you mean something else by stateless but I cannot figure it out.

      State implies retained state across MULTIPLE connections/hits. Most application require state, however state does not need to be kept on the web servers and sometimes not even on app servers.

      HTH

      -Em

      --
      RelevantElephants: A Somatic WebComic...
  27. Read a lot, ask a lot of questions by ToasterTester · · Score: 2, Informative

    This is one of those areas that is there is no set answer. There are lots of articles on the topic, but usually on systems larger than you plan to do. Go to user groups, but many in user groups are doing smaller site, but some might be doing what you are.

    Main thing is define what you call a lot of traffic. A lot to one person isn't a lot to another.

    Then nail down your budget that will be your most defining factor.

    Then when designing use a design that is easy to scale. That way if you are off you can scale with little pain.

    Personally I would put money into the database server, they can be real pain to scale. The web side design as a farm even if only two web servers to start with. Decide how you plan to load balance. A couple web boxes DNS round robin will do, but bigger you have to look to real load balancing options. Also what is your SLA that will determine how big your farm needs to be or if to keep hot or cold spare boxes around. IF a farm how are you going to keep content in sync? Then power, cooling, Security, and on and on. Its a lot of work, but when done and everyone is happy you can't wait for a even bigger project.

  28. Performance planning and scalability by punker · · Score: 2, Informative

    I work for a website that does alot of traffic (it's a specialized industy, and no it's not pr0n). The site pushes about 10Mbit/s from 9-5 during the week through 6 webservers. There are a couple things you need to look at as far as making a site like that work.
    The first thing you should do is look at your system and determine what your resource drains are. Do you have a database? Is it read-write or read-only? What are your replication and growth options for that app? That affects your scalability at that point and similarly applies to applications like EJB or other app servers. Do you use sessions? Do you have some sort of session aggregator available so sessions could be accessibly from multiple webservers? There are lots of things like this you need to find. I for example, setup seperate webservers (tux & apache) to handle static and dynamic content so that my DB connections would not be held by processes not using them.
    The next thing you need to do, is know how your system is used. You should be able to statistically break this out from your logs by looking at a small set of users during testing. I found that 60% of my hits were to one page, and I knew I had to really optimize that (someone mentioned apache bench, which can work very well for testing single pages). Also, you need to know how parts of your site use your resources. If you have a single DB server and multiple webservers, you don't want anything slowing your DB because that cascades back to your webservers. We have pretty strict performance testing guidelines whenever a part of the site is updated, and I recommend doing your performance testing as you go.
    The final thing you need to do, is have a growth plan. Do you know how to setup load balancing for your webservers? Can your DB/app servers be replicated, or do you just need to buy faster hardware as you grow? Do you know your capacity thresholds from your performance testing? If your system is going to grow, you're going to need to be able to answer these questions.
    If you make sure you've got your scalability issues known, and you don't lock your self into something that can't grow, you should be ok. Beyond that test for speed under load, and track how your performance changes over time. That will help you know when you need to grow your hardware. HTH.

  29. Experience is key by xrayspx · · Score: 4, Informative

    Knowledge comes from Experience, and experience comes from Doing.

    Mistakes will be made, They key is in mitigating the effects of those mistakes. Redundancy and Manageability are your two biggest buzzwords here. A good load test and utilization projections are definitely key, but no matter what you think your userbase will be, if it's a public application, you'll almost certainly be wrong. Try to prepare for the most traffic possible.

    Redundancy on every level, including switching infrastructure is a very good plan. Any decent server sold can use multiple bonded NICs for reduncancy, if possible design your network such that if a switch fails, your network will fail over to another switch, etc.

    I would suggest going to many local datacenters and interviewing each with probing questions relating to your situation. You will find that they are all relatively equal in terms of Standard DC items:
    Diversity of route (physical entrance of cabling into the building) and redundant carriers.

    Cooling

    Power and backup gens

    The things they differ on will be the readiness of their NOC team (do you have to fill out a web-form or call a call-center in East St. Louis to get a problem fixed in San Jose, or can you just "call the NOC and somene goes to your cage"), the monitoring/alerting they provide their customers for issues on the datacenter network. Infrastructure-wise, most DC's can provide you with Ping/Power/Pipe, but the service and SLAs are where they get points.

    Do a LOT of reading. Depending on your platform, you have many choices. Linux vendors and Microsoft both have good platforms WRT building redundant networks, provided you do your homework.

    Which brings you to manageability. Make sure that you have a deployment framework you can live with right from the start. Deploying code by hand is alright when you have 2 sites in IIS x 3 or 4 machines, but it gets hairy when you have 15 sites x 20 webservers. Make sure you can deploy web content, mid-tier apps, etc, with the "click of a button". This helps to ease the possibility of repetitive mistakes being made. Depending on the app, you may have to roll-your-own, but it's worth it.

    Scalability. Make sure you pick a DC that can grow with you. If you plan to start out with 4 1u rackmount webservers and maybe a 7u DB, plus some storage array, make sure there is "room to move" in the DC without needing to cross-connect all over their facility with a cage here and a couple cabinets on the other end. Scalability testing by your engineers would be a great plan also. During load testing, if you're planning on using 2 mid-tier servers to process "Project X" from the web-users, set up 6 or 8 and load them up with bogus traffic. See how long it takes to kill your DB server.

    Monitoring/analysis. Make sure you have a monitoring system into which you can hook custom monitors and alerts. Of your installation, those parts with the lowest levels of monitoring will be the ones most prone to breakage. Good packages here are NetCool and HP Openview. Expensive though. It's something you can probably write in-house until you need to spend the big bucks for an enterprise package.

    Look to do a lot of reading, but break it into chunks. There is (I hope) no book called "Building and Maintaining High Traffic Enterprise Networks, for dummies, vol2". Every network will be different. But if you componentize your search, you will yeild great results. If you look to build your own monitoring or code deployment system, read up on WMI, read Cisco related newsgroups for network layer redundancy, etc.

    Consultant is NOT a dirty word. Make sure you hire one for the right reasons. You do not want someone to come in and "make it so". You want someone with more experience than you have to work WITH you to design a network that you understand, can maintain, and which will scale. There's an art to it, hire Chris van Allsburg, not Picasso, Dali or certainly not Poll

    1. Re:Experience is key by xrayspx · · Score: 2, Funny

      Fuck me. I'm ripping the "K" and "Y" keys from my laptop right now. I can't believe that post. I sound lie some bonehead owledge engineer.

      eep it real.

  30. Re:This is the type of question by deesine · · Score: 2, Insightful


    You've got to kidding, right?!

    This guy's asking how he might setup a race car for the NASCAR circuit. And you're telling him; forget about $big block engines, forget about $super injected fuel & exhaust flow, forget about $blue-printing the motor...you can get the same performance from your Escort, just press harder on the gas pedal!

    Thanks for the laugh! LOL

    -d

    --
    damaged by dogma
  31. ...as always, it depends... by Bob+Bitchen · · Score: 3, Insightful

    First off, I'd say you're doing this bass-ackwards. You really should have already answered all these and many other questions before ever laying fingers to keyboard.

    It depends on lots of things. Who's going to manage the self-hosted host? If they have an IT dept. maybe they can provide the hardware sizing. In any case you will first need to establish the usage patterns and then go forward from there.

    --
    http://tinyurl.com/3t236
  32. ApacheCon.com - learn from the experts by dirkx · · Score: 2, Informative
    Just hop on a plane to LasVegas - We're having the ApacheCon (http://www.apachecon.com) this week - with at least half a dozen tail on that topic (in the httpd, java, perl and php fields). Though the more hands on oriented tutorials will already start today - :-)

    A good alternative is the book by OReilly - Web Performance Tuning (http://www.website-owner.com/books/servers/webtun ing.asp).

    Dw.

  33. Load balancer + content differentiation by chrysalis · · Score: 5, Informative

    I have some experience with administration of web sites with very high traffic. My previous experience was with p0rn sites (lots of sites, lots of concurrent accesses). My current job is at Skyrock / Skyblog, that serves about 25 million pages every day.

    In both jobs, the infrastructure was extremely similar.

    The entry point is one (or more) load balancer.
    A load balancer will not only blindly allow you to have multiple backends. It will also accept client connections, buffer the request, get the data from already established (keepalive) sessions, buffer it, and transmit it though large chunks to the client. This, alone, really helps to reduce the number of Apache processes that are taking resources (especially memory) for nothing.

    The load balancer can also do other things, like protecting the servers against some attacks, plotting the current workload of every backend, compress HTML pages, etc.

    At my previous job, we were using Foundry Serverirons. Now, we are using Zeus ZXTM http://www.zeus.co.uk/ with great success. Although it's very expensive software, it's way cheaper than Foundries, way more configurable, way more user-friendly and we are very pleased with it so far. A single PC handle 300 Mb/s (Linux 2.6 is needed for epoll).

    The load balancer can also be configured to send the requests to this or that server according to the request.

    Thus, servers are dedicated to specific tasks.

    We have a bunch of static servers for static HTML, CSS, images, etc. They run minimal Apache servers, designed for speed, with NPTL and the worker MPM. Non-forking servers like thttpd or lighttpd is also an option. The static servers are mainly old P3 machines, with only 512 Mb RAM.

    Then, we have servers for PHP. The Apache they are running is huge (our web sites need a lot of modules), the hosts are dual 3 Ghz Xeon with 2 Gb RAM and there are some other specific tweaks.

    Content differentiation is important. It's a waste to spawn huge Apache process to serve static stuff, just because the same host should also be able to serve PHP. Also, tuning (esp. NFS) is very different for static and dynamic content. And as a specialized server often serves the same files, caching is more efficient.

    We run Gentoo Linux on all web servers, plus one DragonFlyBSD (mostly for testing).

    The same content differentiation is made for SQL server. One SQL server serves one sort of thing, so that caching is efficient. Also don't forget that on x86, Linux and MySQL can hardly use more than 2 Gb of RAM. So with big tables, this is really annoying. We are switching SQL servers to Transtec Opteron-based servers for that.

    On high traffic infrastructures, the I/O is often the bottleneck especially if you serve a lot of different content.

    For our blog service, we had to buy a Storagetek disk array with 56 disks (fiber channel, 15k) in RAID 10. As NFS would introduce too much delay, we directly plugged two web servers to the controller of the disk array. These web servers are the NFS servers for the PHP servers, but they also directly serve the static content.

    The access time of hard disk is really annoying. For shared data, but also for databases. We found that RAID 5 was way too slow (even with the high-end Storagetek/LSI controller) since we have about 1 write for 5 reads. So we had to switch everything to RAID 10. It really performs better, but it's obviously more expensive.

    Another bottleneck was the share of PHP sessions between all load-balanced PHP server. We first used a MySQL/InnoDB-based solution, but it poorly scaled. That's why I had to write specific software : Sharedance http://sharedance.pureftpd.org/

    In a high-traffic infrastructure, my hint would be to use many modest, but specialized servers over one huge mega-fast server that does everything. This is way more scalable. And easier to manage, even from a financial point of view. You can b

    --
    {{.sig}}
  34. Lessons since '99... by xanthan · · Score: 4, Informative

    You don't mention if you're on the applications side of the world or the network, so I'll cover a little about both.

    1. If you're on the app side, make friends with the network side and vice versa. To understand web site management and acceleration, you will need to know about both parts. Making peace with the other team is crucial to a successful site.

    2. If you are on the app side, start thinking about concurrency from the start. You're going to have not 2-3 users at the same time, but more like hundreds if not thousands. This means that you can't do things like lock up tables and the like in the database. If at all possible write your application so that users don't need to come back to the same server to track their session information. Make sure each request is tracked quickly and easily. Also, differentiate your static content from the dynamic content -- you'll eventually want to cache the static content and life will be easier with static objects being served out of a known location. And please... please, please, please... make sure your app generates clean HTTP headers. Set your cache controls correctly, don't duplicate headers, don't be a smart-ass with your headers. Just use clean headers. ASSUME that there will be proxies between you and the client. ASSUME that you will not be able to control all of them.

    3. Don't forget about megaproxies. Depending on the nature of your site, you're going to have a ton of your users coming from a small handful of addresses. (e.g., AOL) While some megaproxies have fixed the issue of a single user coming out of multiple proxy servers, all have not. This means anything that you use for client IP persistence is broken.

    4. Client IP addresses... don't assume you have them. Don't assume they represent a unique user. They don't. Many load balancers/web accelerators also need to act as proxy and will replace the client IP address anyway. (Don't stress about logging -- any reasonable one will insert the client IP address in a HTTP header that you can extract like X-Forwarded-For:)

    5. Peak load on your web servers. Apache can go fast, scale, blah blah blah... my ass. It's not the web server or operating system that is going to determine your peak performance. It is your application itself. Be prepared to fess up to the reality that your application peak performance is not going to be hundreds or thousands of requests per second unless you go insane with the optimization. (e.g., write your application into the web server and embed the whole thing into the kernel, etc.) Assume you're more likely going to get a few dozen requests/sec per app server. Keep that in mind as you plan server purchases and scaling.

    6. HTTP request does not equal TCP connection. Don't assume that. With HTTP multiplexing like the stuff that Netscaler does (web accelerator), you're going to see most of your requests coming out of a small handful of TCP connections. Make sure your application supports that. Even if you don't use a web accelerator, browsers will do that do. Don't cheat and force the connection closed on every HTTP request, your web server will crap.

    7. This is related to 6, but don't forget that web connections are very short lived compared to what the original designers of TCP were thinking about. As a result, you're going to run into cases where you run out of epheral ports (netstat -an will show a ton of ports in TIME_WAIT) even though your machine is idle. This is why HTTP Multiplexing is important -- you don't want a lot of connection churn. Yes, you can tweak your OS settings so that TIME_WAIT expires quickly, but that isn't going to help your overall performance. (TCP connection setup/teardown is a huge burden on a HTTP request that may only span a few packets...)

    8. Look into HTTP acceleration technology from the get go. I've used several different brands and I've found Netscaler's to be the best. They are crazy fast and capable boxes that have a ton of features (like the HTTP multiplexing, SSL acceleration, HTTP compression, web

  35. look at siege, httperf, and autobench instead by smitty45 · · Score: 2, Informative

    better than ab is siege, which can deal with HTTP/1.1 Keep-Alives, and give more regression-style stats. it's at joedog.org.

    better than siege would be something like httperf, and autobench, which will give you some indication whether or not your client generating the requests is still healthy. autobench also allows you to run multiple instances of httperf on different machines, and then aggregate the numbers after the test.

    remember folks, there are only 65535 (minus 1024) ports that any machine can be using with one IP...that has to be considered as well, including at the load balancer layer.

  36. Scaling a high traffic site by DFossmeister · · Score: 2, Insightful

    First, although 300 locations with a few users each may sound like a high-volume site, it is not. I don't want to burst any bubbles, but it simple is not high-traffic in today's world. I work with large e-tailing sites that get 200,000 unique visitors per hour.

    The first step is to determine the type of load you will receive. Is it call-center type traffic, where they will have dedicated staff accessing the application, or will it be more like Internet traffic that comes in waves when it feels like it? If your application fits the call-center model, then you need to know the maximum number of operator-types that will be online at any given time. If it is more like an Internet site, such as Slashdot, then you need to either project the number of sessions per hour, also called the arrival rate, or examine the web logs to find out.

    Concurrent users and arrival rates are not the same--one is the output of the other. In arrival rate mode, the number of concurrent users vary depending on the number of visitors arriving that minute, and the speed of the site. If the site slows down, which is will at a higher rate of visitors, then the sessions will take longer. If the sessions take longer, then visitors continue to come to the site and the number of concurrent users rise. Internet visitors do not know how many users are on the site and certainly won't obey any threshold that you determine.

    The second step is to test over the Internet, and from as may remote locations as possible. You said that there were to be 300 remote offices. Are these all in the US, or are any of them International? Testing on a local LAN does not tell you much of anything, because there is no latency and everything runs at the speed of your switch. Very few people have 100 megabit connections to the Internet, so it is not realistic to test that way. Real users have a mix of line speeds, and come from a variety of locations. It is best to test from 5 or more geographically disperse locations, using a distribution of the line speeds that your end users will be using. If each of these 300 site has a T1, and each site has an average of 3 users, then each user should run at 512Kbps, not 1.54Mbps.

    Lastly, perform realistic transactions on the site, don't just simply hit the home page. Real users on the site will probably start at the home page and traverse the site, doing various things. You should have an idea of what these actions will be, or you can examine the web logs to determine the top 10 paths through the site. Then write scripts for each path and run them proportionately. You also need to build in think or dwell times into each page. Real users don't go from page to page as fast as possible! They take time to fill out forms. A good load test takes into account how familiar a person is with the site and what the person's patience with the site will be. A person using an SSL connection purchasing something has more patience that someone browsing a catalog. By the same token, an operator-type person does not have any choice about whether they can use the site or not, however their productivity will be directly proportional to the speed of the site.

    There are very few open source or free tools that do these things for you. Your options are to 1) wing it as best you can using the SWAG method you described, or 2) seek help. There are various Do-It-Yourself outsourced solutions, such as Test Perspective or some other total outsourced solution. The DIY method will probably get you the best value, but you are subject to your own work, and don't have anyone to blame if things go wrong.

    --
    No Not Again! Its whats for dinner.
  37. Re:most porn companies are clueless by Neil+Blender · · Score: 2, Interesting

    Most porn companie are clueless,...They get a MAJOR SCREWING from hosting companies that charge big $$ to figure out how to handle the load.

    Real porn companies don't host, they colocate. And real porn companies - real porn companies - are well advanced beyond your Slashdots and your CNN.coms. They don't push an agenda, they push what serves millions of page views without 500s or login problems or 'nothing to see here, move along' warnings. Porn is always bleeding edge on the technology front. And porn made the internet what it is today.

  38. Large Scale Infrastructures by Floody · · Score: 2, Informative

    1. Foundry ServerIrons at the front-end layer.

    2. Front-end proxying/caching. Not just static content either, take dynamic content that need not be updated often and put it on the front-end in a fashion that does not require over-weight httpds (i.e. no mod_perl). Use session affinity tricks on the front end (such as mod_rewrite with cookies). squid for caching as necessary.

    3. Back-end heavy servers should have a maximum amount of memory, and obviously lower maxclients.

    4. NetApp storage on the back-end, scaled as needed.

    5. http://www.backhand.org/mod_log_spread/

    6. Well designed network topology and aggressive switch partitioning: hint, use vlans and minimize trunking.

  39. Re:most porn companies are clueless by AndroidCat · · Score: 2, Funny

    I think their current economic model consists of getting rich off of each others' click-throughs and showing thumbnails of each others' thumbnails.

    --
    One line blog. I hear that they're called Twitters now.
  40. an answer... by drasfr · · Score: 3, Informative

    yes, i Know you asked how can find how to setup a high traffic architecture. I think you came at the right place on Slashdot.

    Although I have never seen really many documentation online, I have setup many architecures in the past, and still able to handle very high volume traffic :10s of millions of pages views a day, most of them dynamic.

    It really all depends on ONE factor: money.

    I will give 2 choices, I have implemented both:
    Appropriate budget:
    Frontends/Load Balancing: We had a pair of of Big/IPs with SSL accelerator, configured for redundancy, that rocks.
    behind them, we had a clustered NetApp F840, with gigabit interfaces, on a gigabit networks.
    Frontends: We were running Apache, with all the binaries, config, webpages, perl scrips located on the shared filesystem. Each machine was a dual CPU, 2GB memory, 2x36GB scsi drive, we had 26 of them, double the capacity really needed so if a machine or two were to go down during the night, no need to worry and it would wait for next day, business hours, great for peaks as well.

    As a database backup we had an Oracle Cluster on a SUN 6650, 14CPUs, 14GB of Memory, connected on an EMC storage. One machine was configured as the master, the other as a standby with the possibility to take down the primary and mount it's filesystem directly from the SAN. Pretty much all the config was on the SAN, on different volumes, and could be mounted on either machine. Each volumes had a copy and an hourly update in case of failure of the primary volume.

    Now for a more realistic scenario with low budget:
    - Load Balancer: Get 2 Linux machines, I'd suggest machines with 2GB Memory, 2x36GB Disk, 2x3Ghz CPUs, with Linux Virtual Server. (http://www.linuxvirtualserver.org/)
    - Build 2 Linux machines that you would use as NFS Server (If you are short in budget also could use them as Oracle or Mysql Server), configure them with 2 external scsi arrays that can be mounted on either machine. If you are really short in budget, don't use external array, but big enough internal drives, and for example rsync to replicate the data between the 2 of them. (I would personnally use LVM, establish a snapshot copy on the master and do a rsync of this snapshot. If you have a database on it, put it in quiet (hot-backup) mode while you do the snapshot
    ).
    - FrontEnds: Get a couples of machines with 2 CPUs, 2GB memory for example, 2x36Gb drives. Configure them to mount the filesystem from the NFS servers.

    - Database, it is budget, use Mysql (or Oracle this would work), configure one machine as Master, the other as read-only. Have all your machines interrogating either machines for read-only requests, and going to the master only for write requests.

    If you need more power: configure more frontends, configure more read-only slave database server. Now if you are write intensive, more than reads, on the database, then it becomes a bit more complicated.

    if you want to know more, contact me off-list.

  41. Re:most porn companies are clueless by AK+Marc · · Score: 3, Funny

    They get a MAJOR SCREWING from hosting companies that charge big $$ to figure out how to handle the load.

    Well, if you are in the porn industry, you should expect a major screwing. However, I would expect the porn industry to know how to handle a load.

  42. Here's what we do in state government: by crazyphilman · · Score: 2, Interesting

    Our sites obviously have to serve millions of people, so they have to be pretty robust. I can't tell you every detail because we're all pretty specialized and don't get to see everything ourselves, but from working with our database guys and network guys, I do have a pretty good 10,000 foot picture of how things work. Here's a general sense of what you'll have to do to really be robust:

    1. Your database gets its own server, as powerful as you can afford. If you're a really big site, you're using Oracle, and really, a database cluster rather than a single server. IMPORTANT: Only the DBA can touch the production databases. Developers MUST submit requests to the DBA for any changes. Nobody should be touching a production database from their desktop, other than maybe being able to run queries to check data, and they use a separate, limited login for that. Changes are done by the DBA ONLY.

    2. You put a firewall between the database server and your middleware server. The firewall is a dedicated device, and you're careful about the ports you leave open. Only the middleware server and DBA workstations on your intranet can touch the database.

    3. Your middleware server(s) are as powerful as you can afford (this will be a theme here) and ONLY run middleware. This means, business rule processing. Everything that touches a database in any way MUST come through middleware -- no direct connections, ever. IMPORTANT: developers don't directly install middleware; network staff only.

    4. A firewall (again, dedicated device) between the middleware server and the web server. Only the web server (and network staff workstations on your intranet) are allowed to touch the middleware server.

    5. A set of web servers for your websites, as powerful as you can afford (hate to keep repeating this, but if you skimp you'll end up screwing yourself down the road). IMPORTANT: Developers should NEVER have access to production web servers; they should give their stuff to the networking staff when it's ready. Also, if you're doing FTP and such, put it on a separate server.

    6. A firewall outside your web server, which only permits port 80 traffic and is twice as paranoid as your other firewalls. Log everything "funny".

    In general, you'll have to hire some people: someone really good at security, to configure all your firewalls, someone good at setting up load-balancing to set up all three layers, someone to help you set up a good development environment...

    One thing lots of people overlook: You'll want a "sandbox", i.e. a dedicated set of test database, middleware server, and web server that your developers can play with when working on their sites. You'll also want to set up a UAT (User Acceptance Test) environment similar to your sandbox, so projects can be moved to UAT for testing before being rolled out to production. You can't do UAT on a sandbox; sandboxes are constantly changing. You need a stable environment for UAT.

    Anyway... Hope that helps, it's just advice, you know? Not all of it directly addresses high-volume sites, some of it is about site stability and security, but I think it all ties in together. If your site is being changed by developers, it won't be stable... And if you don't have a paranoid firewall setup, it won't be secure. A lot of webmasters would consider this layout to be (putting it politely) seriously paranoid, but hell, just because you're paranoid doesn't mean they're not out to get you. And, anyway, like I said, high volume does imply these other considerations...

    Good luck!

    --
    Farewell! It's been a fine buncha years!
  43. See how Wikipedia does it on a shoestring by gtoomey · · Score: 3, Insightful
    Look how Wikipedia organises its cluster on a shoestring budget.

    - Over 750 requests/second on 29 - servers average >20 requests/second each (Yes I know some are not http servers) . Compare that to some commercial solutions.
    - commodity hardware
    - squid for cacheing/load balancing, feeding Apache
    - multi-tiered archtieture
    - dual Opteron for the master mysql database

  44. MySQL and 8GB of RAM on X86 by Jamesday · · Score: 2, Informative
    "don't forget that on x86, Linux and MySQL can hardly use more than 2 Gb of RAM" ...unless you want to, as we do at wikipedia.org:
    top - 06:17:34 up 27 days, 18:27, 3 users, load average: 6.46, 6.64, 6.32
    Tasks: 63 total, 2 running, 61 sleeping, 0 stopped, 0 zombie
    Cpu(s): 8.3% us, 2.5% sy, 0.0% ni, 29.5% id, 58.0% wa, 0.4% hi, 1.3% si
    Mem: 8135268k total, 8098184k used, 37084k free, 59776k buffers
    Swap: 2040244k total, 1082360k used, 957884k free, 1364128k cached

    PID USER PR NI nFLT VIRT SWAP RES SHR S %CPU %MEM TIME #C COMMAND
    23983 mysql 15 0 559 6621m 353m 6.1g 18m S 0.2 78.9 11:44 0 mysqld
    That's the master server of wikipedia.org, a few minutes before I posted this reply. Dual Opteron, 8GB, 6x15K SCSI in RAID 10. FC2. 5GB+ for InnoDB. Been that way for many months now, without any major troubles. Not that there haven't been some, but it does the job. A pair of 4GB slaves are FC2 as well. 2.6/FC2 has issues in some builds on some systems, so it's not entirely smooth going. Just to complete the picture:
    MySQL on localhost (4.*) up 0+18:41:33 [06:25:18]
    Queries: 151.4M qps: 2359 Slow: 57.5k Se/In/Up/De(%): 60/00/00/00
    qps now: 1075 Slow qps: 0.2 Threads: 92 ( 12/ 179) 74/00/00/00
    Cache Hits: 26.7M Hits/s: 416.6 Hits now: 183.0 Ratio: 29.3% Ratio now: 23.0%
    Key Efficiency: 98.9% Bps in/out: 29.4k/51.3k Now in/out: 109.2k/486.9k
    You might have intended to exclude Opteron systems from X86 but it's worth clarifying. Lots of excellent points in your post. Like forget RAID 5 for the database servers.
  45. Don't guess by dubl-u · · Score: 2, Insightful

    My guess is going to be that the bottleneck is going to the the database, but we've done extensive testing with a million customer sample database running multiple instances of test applications from 10 other boxes, but that doesn't exactly prove much as it's too predictable.

    Don't guess. You have too much riding on it to guess. Build proper test infrastructure. Not only will it pay off now, but it'll be hugely valuable in the future as you change and expand the application.

    If you're not sure what real users will do, get some to try it out and record their activity. Then spend a little time building a load model, where you describe types of users, their activity patterns, and their expectations. (E.g.: "At the end of the month the 800 salespeople will rush to meet their quota, and during a peak hour they'll each do..." Generally I end up with nice series of spreadsheets, so I can adjust registered users and see peak hits per second come out the other end.) Then simulate the projected load and see where the real bottlenecks are.

    You should be really wary about optimizing without data. As Knuth says, "Premature optimization is the root of all evil." I know a number of people who build very high volume stuff, and I don't know any of them who haven't been frequently surprised at exactly where the bottleneck turned out to be.

    Also, start small and work up. There's no need to build a huge load testing suite all in one go; often you'll learn enough from the first simple tests to point developers and sysadmins in the right direction.

  46. Memcached? by AmVidia+HQ · · Score: 2, Interesting

    Your sharedance software is interesting. Don't know if you are aware of memcached though, (http://www.danga.com/memcached/, by Livejournal guys) and if so did it lack something that prompted you to write your own?

    --
    VIVA1023.com | Political Fashion.