Jump to content



Photo

OS X Server Performance


  • Please log in to reply
59 replies to this topic

#16 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 07:14

Nice!



Once of the nice things about running a LAMP stack is that you don't have to worry about tracking the versions of any packages. So long as you keep up with repository updates, you automatically get the latest operating system and software updates for every piece of software on your system. The maintainers of each package worry about security and version updates. Also, dedicated is the way to go for your web server. You will absolutely get the best performance that way.

If you're new to the command-line, Unix for the Beginning Mage should help you get a good grasp on the basics. One of the best features of modern Linux distros is their package management systems, which you should also be very familiar with. In my (obviously biased) opinion, Debian's Advanced Package Tool is by far the best. You can find a good APT tutorial on the Debian Wiki.

Edit: The Unix for the Beginning Mage link seems to be broken at the moment, so I attached a copy of the PDF to this post.


I got used to the Unix terminal because of first getting a taste of Debian's Apt, thanks to SSH'ing Media Temple's Dedicated Servers a while back (of course it's still all different commands, but I wasn't a shell person at first of course). I worked with homebrew to get some packages installed on this Mac, and I do with with curl and whatever's necessary to make & install.

Here's a reason why I preferred using the GUI for packages such as MySQL. I removed "root", or changed, and all passwords on every database 25 characters generated. That's why I prefer seeing things first hand because I don't do simple security either.


#17 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 18 January 2013 - 13:52

I got used to the Unix terminal because of first getting a taste of Debian's Apt, thanks to SSH'ing Media Temple's Dedicated Servers a while back (of course it's still all different commands, but I wasn't a shell person at first of course). I worked with homebrew to get some packages installed on this Mac, and I do with with curl and whatever's necessary to make & install.


Rather than downloading and compiling source packages directly, you should try the MacPorts package manager for OS X.

Here's a reason why I preferred using the GUI for packages such as MySQL. I removed "root", or changed, and all passwords on every database 25 characters generated. That's why I prefer seeing things first hand because I don't do simple security either.


Could you please elaborate? I don't quite understand what you're trying to say.

#18 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 20
  • Joined: 20-February 11
  • OS: Windows 7/8.1, BSD Unix, Arch Linux
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 18 January 2013 - 14:12

The same server I'm using for my sites is also my desktop because it's all I honestly have at the moment.

Just throwing this out there, have you considered virtualizing? That's assuming your system is up to the task of course. A few of my servers here are virtual instead of physical machines, and the performance is very good, almost as fast as running it bare metal or a proper install, when the servers are idle there's practically no performance hit. I have them running as a service that suspends to disk when I don't need them, so near instant startup and shutdown. Install whatever distro that does it for you, administer via SSH (or throw on a web based admin console if you want a bit more easymode) and you get the full LAMP stack (and other server goodies) without giving up your preferred desktop or dealing with problematic ports. Added benefits of a buffer between your system and the server in case of security problems, very easy to back up, zero cost, if you've a battery backup the server is covered too, etc. Most of them here are done with vSphere but a couple are plain VirtualBox on my desktop system (headless services) and I've been very pleased with the results.. wouldn't even know its there unless I looked at the task manager.

#19 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 19:03

Rather than downloading and compiling source packages directly, you should try the MacPorts package manager for OS X.



Could you please elaborate? I don't quite understand what you're trying to say.


I use Sequel Pro to manage the MySQL users and tables because the majority of the passwords, user id's or even the tables are complex. The passwords are generated. Symbols, Numbers, and Letters. The Databases basically have a 4 letter acronym, and then has generated numbers and letters. Same thing for the prefix and user id's. So I basically make it all hard enough for me not to remember but I always have my own secured notes.

Just throwing this out there, have you considered virtualizing? That's assuming your system is up to the task of course. A few of my servers here are virtual instead of physical machines, and the performance is very good, almost as fast as running it bare metal or a proper install, when the servers are idle there's practically no performance hit. I have them running as a service that suspends to disk when I don't need them, so near instant startup and shutdown. Install whatever distro that does it for you, administer via SSH (or throw on a web based admin console if you want a bit more easymode) and you get the full LAMP stack (and other server goodies) without giving up your preferred desktop or dealing with problematic ports. Added benefits of a buffer between your system and the server in case of security problems, very easy to back up, zero cost, if you've a battery backup the server is covered too, etc. Most of them here are done with vSphere but a couple are plain VirtualBox on my desktop system (headless services) and I've been very pleased with the results.. wouldn't even know its there unless I looked at the task manager.


I tried asking about that in the Mac Support forums, but only got to the solution of installing MySQL correctly and got the server to work as a whole. I wanted to do that as I do have VirtualBox, and I'm wondering which is the fastest Linux for me to do this with. I just hate having to bind IP Addresses.

#20 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 20
  • Joined: 20-February 11
  • OS: Windows 7/8.1, BSD Unix, Arch Linux
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 18 January 2013 - 19:19

I tried asking about that in the Mac Support forums, but only got to the solution of installing MySQL correctly and got the server to work as a whole. I wanted to do that as I do have VirtualBox, and I'm wondering which is the fastest Linux for me to do this with. I just hate having to bind IP Addresses.

Can't comment on networking in OSX, my experience with OSX is basic at best. (Minor dabbling with a Hackintosh for compatibility testing, just not my thing.) But for me, went with a bridged network setup myself so it's got its own full network presence as it's in a server role, will obviously need to adjust your port forwarding rules in your router if that applies as you'll have a different IP for that machine.

As far as the distro goes.. ask 20 people, you'll get 25 answers. Personally, for a server setup I prefer FreeBSD, but for Linux I typically go either Ubuntu LTS or Debian Stable as it's purely as server setup, stability over all else, and they get a lot of attention as far as security patches go. Also helps that they're quite popular and has a metric crapton of documentation available. Speed probably isn't going vary much at all, as they should be a pure console (and eventually headless) setup, no X, no desktops, none of that stuff.. at the end of the day they'll all be (more or less) running the same stuff. They're easy to set up too out of the box, Ubuntu Server 12.04 LTS for example asks you during installation for a few things, including giving you the option to set up a full LAMP stack out of the box, just need to give it a root password for the SQL server and that's literally it, it's ready to go on startup. Of course you'll want to review things after for security hardening, never mind configuring the site, adding other services (Apache modules, Rails, Tomcat, yadda yadda depending on your needs.)

For typical use I just use SSH, a file manager and occasionally an STFP client, that's not including various editors and whatnot of course depending on what you're doing. Once you get the thing set up as you like, it should be a pretty simple matter of getting it to start and stop on command headless, a quick search shows a few writeups on how to do it with minimal fuss. Mine runs on boot headless, will suspend to disk when it's time to shut down again, very seamless overall.

#21 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 19:34

Can't comment on networking in OSX, my experience with OSX is basic at best. (Minor dabbling with a Hackintosh for compatibility testing, just not my thing.) But for me, went with a bridged network setup myself so it's got its own full network presence as it's in a server role, will obviously need to adjust your port forwarding rules in your router if that applies as you'll have a different IP for that machine.

As far as the distro goes.. ask 20 people, you'll get 25 answers. Personally, for a server setup I prefer FreeBSD, but for Linux I typically go either Ubuntu LTS or Debian Stable as it's purely as server setup, stability over all else, and they get a lot of attention as far as security patches go. Also helps that they're quite popular and has a metric crapton of documentation available. Speed probably isn't going vary much at all, as they should be a pure console (and eventually headless) setup, no X, no desktops, none of that stuff.. at the end of the day they'll all be (more or less) running the same stuff. They're easy to set up too out of the box, Ubuntu Server 12.04 LTS for example asks you during installation for a few things, including giving you the option to set up a full LAMP stack out of the box, just need to give it a root password for the SQL server and that's literally it, it's ready to go on startup. Of course you'll want to review things after for security hardening, never mind configuring the site, adding other services (Apache modules, Rails, Tomcat, yadda yadda depending on your needs.)

For typical use I just use SSH, a file manager and occasionally an STFP client, that's not including various editors and whatnot of course depending on what you're doing. Once you get the thing set up as you like, it should be a pretty simple matter of getting it to start and stop on command headless, a quick search shows a few writeups on how to do it with minimal fuss. Mine runs on boot headless, will suspend to disk when it's time to shut down again, very seamless overall.


I'm aware on how to set it all up, I'm just wondering the best OS, BUT I do have concerns about Memory and CPU usage for the Virtual Box as a server, since this Mac Mini only has 4GB of RAM and a Dual Core i5, it's the latest Mac Mini basic.

#22 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 20
  • Joined: 20-February 11
  • OS: Windows 7/8.1, BSD Unix, Arch Linux
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 18 January 2013 - 19:43

I'm aware on how to set it all up, I'm just wondering the best OS, BUT I do have concerns about Memory and CPU usage for the Virtual Box as a server, since this Mac Mini only has 4GB of RAM and a Dual Core i5, it's the latest Mac Mini basic.

Here's just an example on resource usage, your mileage, variance and all that. This particular machine is a Win7 x64 Core2Duo 3.0Ghz, couple of years old, nothing fancy by any stretch. This one VM server I use for development is Ubuntu Server 12.04 LTS (x86), allocated it 2GB maximum memory, not that it's not that it's actually using that much. It runs Apache, MySQL, Ruby/Rails via Passenger, and Webmin because I'm lazy at times, along with OpenSSH and all that. Process Hacker is telling me it peaked at 188MB memory used, idle CPU hovers at 0.3%. Before I upgraded this machine, it only had 4GB and it didn't run Rails at the time.. it was usually under 90MB. 90MB is less memory used than what I see out of many desktop applications, and that's the whole OS. I can't say OSX will handle it the same, but for my particular OS and hardware, it's like it's not even there, even when I only had 4GB in it I didn't notice any hits unless I had it updating or something. Best bet.. give it a test drive, it's all virtual so if it sucks, just nuke it again. I'm guessing though it should run quite well on your hardware, assuming you don't bloat it up with things like X, a desktop environment, etc.

#23 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 20:10

Here's just an example on resource usage, your mileage, variance and all that. This particular machine is a Win7 x64 Core2Duo 3.0Ghz, couple of years old, nothing fancy by any stretch. This one VM server I use for development is Ubuntu Server 12.04 LTS (x86), allocated it 2GB maximum memory, not that it's not that it's actually using that much. It runs Apache, MySQL, Ruby/Rails via Passenger, and Webmin because I'm lazy at times, along with OpenSSH and all that. Process Hacker is telling me it peaked at 188MB memory used, idle CPU hovers at 0.3%. Before I upgraded this machine, it only had 4GB and it didn't run Rails at the time.. it was usually under 90MB. 90MB is less memory used than what I see out of many desktop applications, and that's the whole OS. I can't say OSX will handle it the same, but for my particular OS and hardware, it's like it's not even there, even when I only had 4GB in it I didn't notice any hits unless I had it updating or something. Best bet.. give it a test drive, it's all virtual so if it sucks, just nuke it again. I'm guessing though it should run quite well on your hardware, assuming you don't bloat it up with things like X, a desktop environment, etc.


That completely made sense to me, I'm gonna give it a try and come back to you on this. I'll work with Debian since I'm most used to it's commands as far as APT goes, OR Ubuntu. I love Ubuntu. :)

#24 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 18 January 2013 - 20:40

I use Sequel Pro to manage the MySQL users and tables because the majority of the passwords, user id's or even the tables are complex. The passwords are generated. Symbols, Numbers, and Letters. The Databases basically have a 4 letter acronym, and then has generated numbers and letters. Same thing for the prefix and user id's. So I basically make it all hard enough for me not to remember but I always have my own secured notes.


In that case, you can fairly easily replace Sequel Pro with phpMyAdmin. It will also let you graphically manage your SQL database.

That completely made sense to me, I'm gonna give it a try and come back to you on this. I'll work with Debian since I'm most used to it's commands as far as APT goes, OR Ubuntu. I love Ubuntu. :)


Both Debian and Ubuntu are good choices for a server OS. Keep in mind that Debian 6 was released in early 2011 while Ubuntu 12.04 was released in mid 2012. Therefore some packages are at slightly older versions in the current stable version of Debian. For example, Apache is 2.2.16 in Debian 6 and 2.2.22 in Ubuntu 12.04. Considering how far along it is in release freeze, you might consider installing Debian 7 instead. It has the same or slightly newer versions of packages that are in Ubuntu 12.04, but some of them are higher quality since Canonical imported packages from Debian Testing before the release freeze. (Canonical uses most Debian packages unmodified since they don't have the manpower of their base distribution, therefore Debian almost always has the newer version.) I wouldn't normally advocate using Debian Testing as your server OS, but Debian 7 is very stable at this point because it is so close to release. The only patches being submitted at the moment are bugfixes.

#25 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 20:53

In that case, you can fairly easily replace Sequel Pro with phpMyAdmin. It will also let you graphically manage your SQL database.



Both Debian and Ubuntu are good choices for a server OS. Keep in mind that Debian 6 was released in early 2011 while Ubuntu 12.04, which is based on Debian 7 in its pre-release-freeze state, was released in mid 2012. Therefore some packages are at slightly older versions in the current stable version of Debian. For example, Apache is 2.2.16 in Debian 6 and 2.2.22 in Ubuntu 12.04. Considering how far along it is in release freeze, you might consider installing Debian 7 instead. It has the same or slightly newer versions of packages that are in Ubuntu 12.04, but some of them are higher quality because Canonical imported for Ubuntu 12.04 before Debian fixed many important bugs. Canonical uses most Debian packages unmodified since they don't have the manpower of their base distribution, therefore Debian almost always has the newer version. I wouldn't normally advocate using Debian Testing as your server OS, but Debian 7 is very stable at this point considering how close it is to release. The only patches being submitted at the moment are bugfixes.


I didn't want to use phpMyAdmin or any web manager because I don't have the MySQL port open to the outside world and I hated using the browser even more for this type of management.

Alright, how about using Ubuntu Server, without the GUI, and just reinstalling apache, php, and mysql to their newest stables?

#26 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 18 January 2013 - 21:06

I didn't want to use phpMyAdmin or any web manager because I don't have the MySQL port open to the outside world and I hated using the browser even more for this type of management.


You don't have to have the phpMyAdmin interface open to the outside world. You can fairly easily restrict traffic on that port to local-only using iptables, or you can just not forward it through your router to begin with. If you just don't like how it works, fair enough; everyone has different preferences.

Alright, how about using Ubuntu Server, without the GUI, and just reinstalling apache, php, and mysql to their newest stables?


If you choose to install the latest stable versions of your software from upstream, which I highly recommend against unless you absolutely need some specific features that only the latest version provides, at least build Debian packages from them (using dpkg-buildpackage or apt-build) so they can be properly tracked (and their dependencies resolved) from the package manager. However, keep in mind that you have to worry about keeping track of the latest versions and security advisories if you choose to install local versions. It is particularly critical that you keep on top of security updates with external-facing services, such as your web server. If you use the version from the repository, not only is the binary guaranteed to work on your system, but the package maintainer worries about security. I can tell you from experience that Debian package maintainers put a lot of effort into ensuring that their packages are secure and work smoothly with the rest of the operating system.

#27 OP Mr.XXIV

Mr.XXIV

    Shine bright like Iron Man.

  • Tech Issues Solved: 1
  • Joined: 30-April 11
  • Location: Durham, North Carolina
  • OS: OS X Yosemite
  • Phone: iPhone 5s

Posted 18 January 2013 - 21:14

You don't have to have the phpMyAdmin interface open to the outside world. You can fairly easily restrict traffic on that port to local-only using iptables, or you can just not forward it through your router to begin with. If you just don't like how it works, fair enough; everyone has different preferences.



If you choose to install the latest stable versions of your software from upstream, which I highly recommend against unless you absolutely need some specific features that only the latest version provides, at least build Debian packages from them (using dpkg-buildpackage or apt-build) so they can be properly tracked (and their dependencies resolved) from the package manager. However, keep in mind that you have to worry about keeping track of the latest versions and security advisories if you choose to install local versions. It is particularly critical that you keep on top of security updates with external-facing services, such as your web server. If you use the version from the repository, not only is the binary guaranteed to work on your system, but the package maintainer worries about security. I can tell you from experience that Debian package maintainers put a lot of effort into ensuring that their packages are secure and work smoothly with the rest of the operating system.


Don't worry, I always trust the repositories. :) That was something I first learned about when I once had Media Temple & GoDaddy's VPS.

I'm currently installing Ubuntu Server on Virtual Box right now, but, what's a preferred amount of RAM and CPU core usage on this 4GB Mac Mini?

#28 Max Norris

Max Norris

    Neowinian Senior

  • Tech Issues Solved: 20
  • Joined: 20-February 11
  • OS: Windows 7/8.1, BSD Unix, Arch Linux
  • Phone: HTC One (Home) Lumia 1020 (Work)

Posted 18 January 2013 - 21:16

If you choose to install the latest stable versions of your software from upstream, which I highly recommend against unless you absolutely need some specific features that only the latest version provides

This times a bajillion, barring special circumstances. Bleeeding edge belongs on the desktop.. servers are all about keeping it stable, one of the big selling points of the stable branch or LTS release depending on which distro you picked. Newer isn't always better.

I'm currently installing Ubuntu Server on Virtual Box right now, but, what's a preferred amount of RAM and CPU core usage on this 4GB Mac Mini?

If it were Windows, I'd do 1GB, not that it'll get anywhere near that for real usage unless you're doing some heavy lifting on it.. but I'll defer to an OSX person.

#29 tim_s

tim_s

    Default

  • Tech Issues Solved: 1
  • Joined: 07-January 13
  • OS: OSX (Macbook Pro i7), Windows 7 (Gaming), Gentoo
  • Phone: iPhone 5s

Posted 18 January 2013 - 21:20

I just want to point out IF the port 80 was blocked - You would not be able to view websites LOL

#30 tim_s

tim_s

    Default

  • Tech Issues Solved: 1
  • Joined: 07-January 13
  • OS: OSX (Macbook Pro i7), Windows 7 (Gaming), Gentoo
  • Phone: iPhone 5s

Posted 18 January 2013 - 21:34

Clearly a website with little traffic would function well on a VM > Mac Mini > Home Network. This is far from ideal - the end result will be frustration as both your usage scenario and setup is going to become problematic pretty quickly.

What budget do you have?

To me it seems you would do a lot better using a virtualized environment - i.e, like blue hosts for example.

Side note,

Just remember while you host / build the websites, you are accountable - I.e. you may end up in court with 4-5 clients recovering their loses.