Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Machine(s) spec question 2

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
Right now I'm running PHP/MySQL on a very modest box... will be upgrading soon.

As it stands the two servers are both on the same box.

The performance is fine now, except when the database spikes, the webserver slows pretty significantly, even for static pages.

Is a dual proc box going to help me out with that particular issue, or is it just a waste of money?
 
Whatever the OS there are a few possibilities:

1) You are CPU bound.
2) You are IO bound, which is to say the MySQL process has the disk all tied up either reading and writing and is starving the apache process for resources.
3) You are thrashing for virtual memory, which means mysql has consumed so much memory that it has forced Apache out of real memory and into virtual memory (onto disk). The apache process has to be read back into real memory in order to run.

You need to determine which of these is the case. If you are running some unix variant then top, iostat and vmstat are very good tools for diagnosing this, but off topic for the PHP forum. If you are on Windows then you are getting what you deserve. ;-)

Once you have determined the problem the respective resolutions would be:

1) Dual CPUs could help, however you could win by optimizing queries.
2) Get a faster disk IO system, or add a new drive and put the mysql data on a different spindle than the static pages.
3) Add more memory.

Hope this helps.
 
The new box will be running linux, though the current box is running windows.

The thing is, I'm not yet running into any problems, I'm simply planning for the future and wondering which upgrades are the most valuable... or if perhaps two less expensive machines is the better solution.
 
I have generally gone the "two smaller machines" route, myself, when possible. Scaling of processors in a single system is not necessarily linear.

But when I do go multiple machines, particularly when dealing with a web server and a mission-necessary database server, I provide a dedicated path between the two machines. If I'm dealing with one web server and one database server, I install two network cards in each machine and connect the two machines by a crossover cable.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Interesting... I'll keep that in mind, they'll be locked up in a server room somewhere so I'll have to ask our network guys what kind of interconnects are already going on between machines in there... but I'll keep that in mind... would likely be a down the road upgrade anyway.

 
I definitely agree with sleipnir214. Take the google approach of a redundant array of inexpensive computers. ;-)

One thing to remember from statistics, the more machines you add, the sooner it'll be that one of them fails. Be sure that you set them up in a manner that when one does fail the others can continue working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top