LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-24-2011, 07:57 AM   #1
yovkoi
Member
 
Registered: Jun 2010
Posts: 37

Rep: Reputation: 0
apache on a virtual machine???


Hi, guys!
I'm Rebuilding all the servers in the company I work for. I read anything I found about best practices in virtualizing, but I didn't find anything about virtualizing Apache. As MySQl is not considered to be virtualized as a best practice but to be on a separate machine - my question is "Do I virtualize an Apache server or put it on another real machine?". And also I'm going to put the server on Ubuntu!
Thank you!
 
Old 01-24-2011, 08:20 AM   #2
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
Quote:
Originally Posted by yovkoi View Post
Hi, guys!
I'm Rebuilding all the servers in the company I work for. I read anything I found about best practices in virtualizing, but I didn't find anything about virtualizing Apache. As MySQl is not considered to be virtualized as a best practice but to be on a separate machine - my question is "Do I virtualize an Apache server or put it on another real machine?". And also I'm going to put the server on Ubuntu!
Thank you!
... depends on the traffic ...

Instead of Apache I suggest to build NGINX... its perfect Webserver for virtualization
 
Old 01-24-2011, 08:39 AM   #3
yovkoi
Member
 
Registered: Jun 2010
Posts: 37

Original Poster
Rep: Reputation: 0
Thanks, man! Then I'm virtualizing it! If it doesn't work well I'll use a separate machine, but I think it WILL!


Quote:
Originally Posted by dlugasx View Post
... depends on the traffic ...

Instead of Apache I suggest to build NGINX... its perfect Webserver for virtualization
 
Old 01-24-2011, 11:08 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
What are the fundamental principles that determine whether an application is best virtualised or native?
 
Old 01-25-2011, 04:00 AM   #5
yovkoi
Member
 
Registered: Jun 2010
Posts: 37

Original Poster
Rep: Reputation: 0
Mostly traffic. That's because database servers have a great traffic they are preferred to be native. At least I've read so...
Here's what I've read
http://www.google.bg/url?sa=t&source...RAt0Rg&cad=rja


Quote:
Originally Posted by catkin View Post
What are the fundamental principles that determine whether an application is best virtualised or native?
 
Old 01-26-2011, 10:28 AM   #6
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
Quote:
Originally Posted by yovkoi View Post
Mostly traffic. That's because database servers have a great traffic they are preferred to be native. At least I've read so...
Here's what I've read
http://www.google.bg/url?sa=t&source...RAt0Rg&cad=rja
Although network traffic is a possible issue, you usually want to use physical machine for heavy I/O operations. Virtualized machines are in general not really suited for this kind of work. That's the reason why it is not advised in general to virtualize a database server.
 
Old 01-27-2011, 09:52 AM   #7
yovkoi
Member
 
Registered: Jun 2010
Posts: 37

Original Poster
Rep: Reputation: 0
Isn't traffic a heavy IO operation!? Isn't it what someone means by saying "heavy IO operation"?

Quote:
Originally Posted by Blue_Ice View Post
Although network traffic is a possible issue, you usually want to use physical machine for heavy I/O operations. Virtualized machines are in general not really suited for this kind of work. That's the reason why it is not advised in general to virtualize a database server.
 
Old 01-27-2011, 11:14 AM   #8
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
Quote:
Originally Posted by yovkoi View Post
Isn't traffic a heavy IO operation!? Isn't it what someone means by saying "heavy IO operation"?
Disk I/O... Disks are often the slowest part in a server. Especially when shared with different VPS's. Actually optic fibre channels are so fast that a HD cannot keep up.

Last edited by Blue_Ice; 01-27-2011 at 11:17 AM.
 
Old 01-27-2011, 11:49 AM   #9
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Apache virtualizes very well, especially if you use PHP or Python scripts and are not constrained by storage I/O.

I recommend trimming the Apache modules, though, to a set that fulfills your needs, but does not include unused ones. Also, limit the maximum run time and memory each script interpreter instance is allowed to use, for both security and stability. That way a runaway script won't be able to consume all available memory and crash Apache.

A typical web site has a lot of small files used on most pages -- CSS stylesheets, user interface images, and so on. These are typically cached in memory (automatically by the kernel, because they're so often accessed) and do not incur physical storage I/O. These are rarely any kind of a bottleneck, since even a low-power virtual processor can fill a 1Gbit/s pipe from memory-cached files. The CPU needed by script pages is usually offset by their lower storage I/O requirements.

The next typical bottleneck is the database server the scripts get their contents from (or, more accurately, the limited number of connections allowed to the database server). Please make sure you have enough connections available to service each script instance Apache is allowed to have, so that users don't get those annoying "Database unavailable" error messages. If using the prefork model, it's perfectly reasonable to reduce the maximum number of children to the number of database connections available.
Nominal Animal

Last edited by Nominal Animal; 03-21-2011 at 07:31 AM.
 
Old 01-27-2011, 12:06 PM   #10
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Quote:
Originally Posted by catkin View Post
What are the fundamental principles that determine whether an application is best virtualised or native?
The general consensus of where I work, one of the car companies, is that anything that is PRODUCTION will NOT be virtualized. Virtualization is best left for development environments due to the ease of staging a new VM for testing.

So anyway, we ignore that and virtualize all kinds of production stuff.

We sometimes run benchmarks of an application on bare-metal, then compare them with benchmarks of the same application virtualized, using LoadRunner to engage the traffic. If it is comparable, within 10%, we will roll with it. If not, we will put it on iron.

In my opinion, Java runs like crap in virtualized environments. Big Mysql db's bottlenecks in virtualized environments. Anything with lots of Disk I/O really suffers, such as FreeNAS and such.

Vmware will stomp their feet and tell you all the great things about virtualization and how it can save you money on hardware, and speed isn't an issue, and blah blah blah. But remember, they are trying to sell you a product, by any means necessary. Virtualization will always cause a hit in performance. It just depends on how much performance you are willing to lose.

IMHO
 
1 members found this post helpful.
Old 01-28-2011, 01:05 AM   #11
yovkoi
Member
 
Registered: Jun 2010
Posts: 37

Original Poster
Rep: Reputation: 0
Thanks szboardstretcher and Nominal Animal. That was a great explanation and I'm gonna put it in use!
 
Old 01-28-2011, 06:02 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by yovkoi View Post
Thanks szboardstretcher and Nominal Animal. That was a great explanation and I'm gonna put it in use!
+1 to that
 
  


Reply



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
unable to auto mount 'shared folder' iin Suse 11.2 virtual machine using Virtual Box marvinudy Linux - Virtualization and Cloud 1 02-03-2010 02:29 PM
How to configure the serial port of my virtual machine with host machine. akram Linux - Newbie 4 07-31-2009 10:39 PM
Running virtual pc files in a virtual machine in linux ... preferably virtual box biharibong Linux - Software 4 01-21-2009 01:04 PM
Apache, forward requests to a vmware virtual machine Hube Linux - Software 2 09-02-2004 09:58 AM
Apache SSL - how to virtual host two or more secure websites on the same machine? bjoshi Linux - Networking 0 08-30-2001 07:01 PM

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

All times are GMT -5. The time now is 06:22 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