Forum Moderators: phranque

Message Too Old, No Replies

Hardware Question: New SQL Server

         

bakedjake

4:51 pm on Apr 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



In the spirit of Need advice for server upgrade. Please? [webmasterworld.com], I have a very similar question:

I'm looking at upgrading our Windows DB platform. We've outgrown our current server (dual P3 Xeon 1.3 GHz, 4 GB RAM) and looking at my budget, are looking at either of the following two options (which are similarly priced):

  • Dual Xeon 3.2 Ghz with 16 GB RAM (533 MHz FSB/1 MB Cache)
  • Quad Xeon-MP 2.0 Ghz with 8 GB RAM (400 MHz FSB/1 MB Cache)

    On our current DB server, the RAM never really goes above 3.3 GB, and I've profiled our queries, so I've decided that CPU is probably the bottleneck.

    The million dollar question, of course, is will SQL Server benefit more from the faster dual processors, or from multiple, slower quad processors?

    An IBM DB guy I know suggested that for my DB needs, the quad config was probably better. However, I know the IBM DB guys are generally CPU happy, so I wanted to get a second opinion. Anyone have any insight on this?

  • digitalv

    5:18 pm on Apr 5, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    IBM guys are CPU happy because they make more money selling additional computers for a cluster, or multi-processor systems over a single system :)

    Having more CPU horsepower, and more RAM, will always increase SQL performance. It depends on how complex your queries are - before you would do anything, I would make sure that your queries are as optimized as they can get AS WELL AS making sure the data in tables is stored in the most efficient manner (using numbers instead of words whenever possible, for example, provides tremendous performance boosts in SELECT queries).

    It's a good idea to make sure that the amount of RAM in your system is greater than the size of your database(s) - that will allow your databases to load entirely into memory. It will use less CPU power because the database is in RAM and doesn't require the drive to spin (so the query is executed faster and doesn't take up the CPU while waiting on data to be retrieved from the disk)

    Also if you have any stored procedures that reserve memory (for example a dynamic SQL statement which uses a 2000 character varchar or nvarchar) - estimate how many users will be executing that procedure at any time, and factor those bytes in to the total system RAM.

    Another biggie for SQL - swap files. If your database is larger than the total amount of RAM your system can HANDLE (ie; your system only supports 16 GB of RAM and your database is 20 GB) then make sure you have a huge SWAP file on a drive other than your system ("C") drive.

    I'm running a Win2k/SQL 2k configuration that receives over 100,000 complex INSERT and SELECT/INSERT statements per day - it's running on a dual Pentium 800 Mhz with 8 GB RAM. When I only had 4 GB of RAM in it, the CPU was averaging 40% - 80% utilization. By adding another 4 GB of RAM, it dropped the CPU utilization down to 10% because the databases could load into memory and didn't require so much disk/swap file access. This is a huge database with millions of records that's read from/written to 24/7. In most cases it's really more about how well optimized your queries are, and how data is stored, over the hardware itself.

    I'm not sure how frequently your data is accessed, but it's generally a better idea to go with more RAM than more CPU's since memory is usually the bottleneck.

    If your RAM is never going above 3.3 GB it doesn't mean that it doesn't WANT to ... it means that you only have 4 GB available and SQL is either configured to only use 85% of the available resources, or other services you have running are taking up the rest. Your CPU is probably high because of swap file usage. Double the RAM in your existing system first and see how much that helps. You might not have to upgrade at all.

    bakedjake

    9:13 pm on Apr 5, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    Thanks digitalv!

    I would make sure that your queries are as optimized as they can get

    Oh yeah, we're well past this point.

    make sure that the amount of RAM in your system is greater than the size of your database(s)

    Check. Got that, although a good tip for future readers.

    over 100,000 complex INSERT and SELECT/INSERT statements per day

    We're at about 200-250K at this point. :-/ We've done as much caching and optimization as humanly possible.

    Double the RAM in your existing system first and see how much that helps.

    Can't - this baby's maxed out. That's why I'm looking to upgrade. The quad setup can take up to 32 GB, but I would be maxing out with the dual at 16 GB. I'm leaning towards getting the quad now, seeing how things go with 8 GB, then adding more RAM as I need it.

    plumsauce

    1:58 am on Apr 6, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    what's the drive subsystem look like?

    a caching raid subsystem on a striped mirror
    set does wonders for db performance.

    bakedjake

    4:41 pm on Apr 6, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    a caching raid subsystem on a striped mirror set does wonders for db performance.

    Thanks plumsauce, good to hear from you again.

    The current machine is a RAID 5. On the new machine, we'll go to RAID 1+0, so I'm in total agreement with you here.

    ara818

    9:44 am on Apr 7, 2004 (gmt 0)

    10+ Year Member



    As a general rule, database performance is first dependent on Disk subsystem, then memory, then CPU. In fact database system performance is *hardly ever* bound by CPU.

    The first thing you want to do, as mentioned before, is try to stuff as much memory into the thing so as to be able to cache your entire, database in RAM (if this is feasible). This helps alot with SELECTs.

    On a system heavy with UPDATES, and INSERTS *nothing* will improve your preformance more than your disk setup.

    1)Make sure your system has a RAID card with *battery-backed* cache, the more cache the better. I can't stress this enough, this will make a huge difference.

    2)As for RAID setup, there are many options. Alot of people have a setup where they keep their OS, programs, AND DB transaction logs (WALs) on a Raid 1, then keep their data on either a Raid 10 or a Raid 5. This helps alot since a DB has to do 2 writes/update, one to the WAL and one to the actual DB data, when these two things are on different disk arrays, performance improves. Alot of people prefer a Raid 5 to a Raid 10 because they can easily just keep adding disks (I've head of setups with dozens of disks) to improve performance. More disks = more concurrent writing = more throughput. More disks also = more empty space per disk = faster seek times.

    Compared to your disk setup, what CPUs you choose will be largely irrelevant. On a write heavy DB a dual PIII 800 with a good disk setup, with beat the pants off a dual P4 3.2 with a not-so-good disk setup. I've actually seen this with my own eyes.

    plumsauce

    5:48 am on Apr 8, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    i will simply add that raid 10 is
    no more of problem that raid 5 as
    long as you are willing to add disks
    in the pairs required. Both the
    IBM and COMPAQ high end adapters
    will allow online expansion.

    Of course, there's always the
    possiblity of using a SAN :)

    Lot's of advantages there too.

    +++

    bakedjake

    7:18 pm on Apr 8, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    The first thing you want to do, as mentioned before, is try to stuff as much memory into the thing so as to be able to cache your entire, database in RAM (if this is feasible). This helps alot with SELECTs.

    Bingo - this is our situation. We do a TON of heavy selects, and a moderate-few amount of writes.

    That right there answers my question - I think I'll go with the quad xeon, as it will allow us to expand to 32 GB of RAM.

    Thanks all!