4

I currently develop for Drupal CMS using The Uniform Server. I also tried Xampp and WampServer. Loading each page of drupal take long more than 50 second which is really painful.

My Computer is:

  • List item
  • CPU: AMD Sempron Processor LE-1100 1.90 GHz
  • Ram: 2 GB DDR II
  • OS: 64 Bit

Here is my question: Does Apache+MySQL+PHP work faster on Linux (CentOs 5.5)? If the answer is yes, How much faster it will be? I like to know is it reasonable and useful to Linux?

bman
  • 219
  • 4
  • 13
  • 1
    I don't know if it's faster but...to me it makes much more sense to use all of these on a Linux box rather than using windows as your backend. And now that I think of it, the overhead of running windows is probably slowing down your machine more than running Linux would. – Alex Mar 09 '11 at 19:13
  • Thats terribly long page load time! Hows CPU and hard disk usage during these times? Your code could possibly be the bottleneck (large database query for example). – xeon Mar 09 '11 at 19:16
  • @xeon: The code is not written by me. Drupal is a famous CMS. I test this in a fresh Drupal install without any module or query wrote by me. – bman Mar 09 '11 at 19:22
  • @Alex: Which Linux distribution do you recommend, then? – bman Mar 09 '11 at 19:23
  • 1
    Well, I'm a BSD guy so I'm probably the worst person to ask :) but the linux distro I used the most is Ubuntu. I like the fact that Ubuntu has a very large community that is eager to help noobs. I rarely saw a RTFM type of answers on ubuntu's forum. – Alex Mar 09 '11 at 19:26
  • They also have clear and useful documentation, such as this one... https://help.ubuntu.com/community/Drupal – Alex Mar 09 '11 at 19:30
  • @Mani since you are new at Linux I would suggest you go with Ubunutu. – Sameer Mar 09 '11 at 19:32
  • A change of OS will not fix a 50 second response time. Something is dreadfully wrong if you are waiting 50 seconds. – brettwhiteman Sep 21 '17 at 11:11

5 Answers5

8

I recently took my six year old windows machine and turned it into a CentOS 5.5 NAS/LAMP. Using software RAID5 for storage and putting the OS on a separate drive also has some performance advantages.

The performance increase has been staggering. The OS performs so much better on the machine than Windows did.

The real advantage to moving to Linux here, was there is no overhead for the window manager as I am running it headless with no GUI.

In short, your dealing with old hardware that will be better served via a Linux environment. I'm a fan of CentOS as I'm a RedHat guy.

Mike
  • 802
  • 4
  • 5
3

Short Answer - You wouldn't notice on modern hardware.

The major benefit here will not be speed but relative performance for the cost. Open source projects are usually designed and tested on *nix (linux/unix/bsd) first, and then 'ported' to Windows. Features usually creep into windows 2nd, not first.

This brings me to my next point...

Licensing fees are the hidden performance cost

If you have a 6 core Linux server it doesn't cost any money to use all 6 cores, and with the money you save on licensing you can buy more memory, or faster disks - this will be the biggest performance increase, not one OS vs Another.

Linux has unique features

There is also the case to make about Operating System features, although many programs don't yet take advantage of them... In the case of epoll vs select() or poll() - windows does not have an equivelant, nor does it have sendfile, or a threads implementation similar to pthreads in 2.6+ Kernels.

Memory and Disk are always the Bottleneck

Processors are SO fast nowadays, processors are eternally starved (yes starved) for data - the system memory is usually 3 - 4 times slower still to this day. The processor usually does 4-5 wait cycles for every memory access. This is why processors have 3 levels of internal caching (L1, L2, L3) to help with this. Disk access will be even a larger factor - so save your licensing pennies and buy more memory, and faster disks!!!

Ben DeMott
  • 316
  • 1
  • 4
  • Actually I have a Linux server which I use for my production site. I have Windows for my development system and I am wondering is it useful to migrate to linux for development purposes. – bman Mar 09 '11 at 19:46
  • Absolutely, I would also recommend Ubuntu... SFTP (secure file browsing), Real-Time editing of source-files on your remote server, RSYNC (sync your changes between your dev server and your live server quickly), Have the EXACT same packages and versions installed on both systems - Two different operating systems sounds like twice the administrative overhead. – Ben DeMott Mar 09 '11 at 19:54
  • If it were me, I'd setup the development box to match the production box as closely as practical-- so, match your development box to the flavor/version of Linux on your production server. – gsiems Mar 09 '11 at 21:11
  • I have to object on the "Windows does not have..." part. Windows does have epoll, it's called completion port, and in fact it has been working much better and more universally than epoll for literally decades. Only recently, with the addition of eventfd, epoll has caught up with completion ports in functionality. Also, Windows does have a sendfile equivalent, although admittedly on the "consumer versions" it is artificially throttled down. There are a couple of excellent reasons for using Linux in favour of Windows on a server, but these are not the lack of epoll and sendfile. – dm.skt Mar 09 '11 at 23:36
  • Just so this doesn't come over the wrong way: I'm not trying to defend Windows, nor would I ever use anything but Linux for a server. It's great. But for different reasons. – dm.skt Mar 09 '11 at 23:38
  • My understanding on completion ports was that they were a Thread based solution, but I am no WINAPI developer - sorry for the misinformation if I am incorrect. And my understanding with sendfile equivalents (dup/dup2 ?) is that they exist in user-space, not kernel space. – Ben DeMott Mar 10 '11 at 03:53
  • Yes, completion ports work with threads (and also, sadly, much better than epoll). Basically, a completion port is like epoll, except you can throw anything at it (socket, file, timer, anything that has a notion of "ready") and it will just work. So, things like AIO+epoll which were a nightmare under Linux until recently worked just fine with Windows for ages. There are some gotchas on older systems, but overall it's stunning. Plus, you can block any number of threads you like on a completion port and it will wake exactly one for each incoming event, as opposed to epoll's thundering herd. – dm.skt Mar 10 '11 at 15:39
  • The Windows sendfile equivalent is TransmitFile, which exists from Win2k onwards. It kind of stinks insofar as they artificially rate-limited it to maximum 2 concurrent transmissions on the "non server" versions. But then again, it is understandable that they would rather sell you a $2000 server license than having you run a server on a $75 license, even though crippling things on purpose is a bit... meh. – dm.skt Mar 10 '11 at 15:44
2

I think most people here would agree a LAMP (Linux, Apache, Mysql, PHP) stack is better than Windows. I would recommend Ubuntu if you're new to Linux, Alex is correct in saying that Ubuntu will get you the best results in the forums. A quick search for "best drupal platform" returns all Linux results.

sreimer
  • 2,218
  • 15
  • 17
  • Ubuntu rocks. If you know absolutely nothing about Linux and can only handle as much as booting from a DVD and making 3-4 choices, you get a running system with quite sane default settings in 15 minutes, up and running, including webserver, database, and whatever you need. Plus, pretty much everything you might ever want is in the repositories. – dm.skt Mar 09 '11 at 23:44
1

My own observations indicate that when properly installed on a similarly configured OS on the same hardware, the Linux machine will perform better. While that can be a very significant issue when using old hardware or virtual machines, as Ben stated, you are unlikely to notice it on current hardware.

I also makes sense to, wherever practical, to run software on the OS it was designed for. Running software ported to a different OS seldom gives the same performance and stability and frequently either lags behind the main development or lacks some of the features.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
0

Same page, same configuration in Linux and Windows 10 of Apache + PHP + MySQL, and it's 4 times faster in Linux than Windows. Why is that?

Linux page loading speed

Windows page loading speed

joan16v
  • 101
  • 3