OS X Server Performance


Recommended Posts

So I'm running a Mac Mini and I'm trying to give a great load of performance (not hardware wise).

What's best practice to make sure it can take as many loads as possible as I do send a lot of traffic.

I tried sudo nvram boot-args="8388608" as a method in the terminal, but I'm not sure if that's the right answer.

Link to comment
Share on other sites

There is no "magic bullet" when it comes to machine performance. If there was, everyone would use it (or someone would patent it, but we'd rather not go there). That said, there are a couple of things you could try (assuming this is a dedicated server; some of these performance optimizations are not ideal for desktops).

In a quick search, I couldn't find anything specifically targeting OS X Server optimization. (Do people actually run that on high-load, dedicated servers?) However, since OS X is based on FreeBSD, the FreeBSD Networking Performance guide might be of some use.

If you're using Nginx as your web server, this guide has some good tips on optimizing it for high load. If you're using Apache (and maybe PHP and MySQL or one of its forks), this guide details some useful optimizations.

Finally, if you're willing to switch to Linux - which I highly recommend if this is a dedicated web server - this Linux TCP/IP Tuning guide is top-notch.

I'm just guessing at what you might be running, and why. If you could provide more specifics it would be really helpful.

Link to comment
Share on other sites

Actually the Mac wasn't set in Performance Mode, apparently that was a setting Apple left for those who want to run the sever better.

Link to comment
Share on other sites

apparently that was a setting Apple left for those who want to run the sever better.a15k3

I wanted to use OS X as the server OS because it felt a lot easier to work with than Linux. Database, Email, DNS, and so much more, all in Terminal or GUI, better than using the Web, with managers such as Cpanel and phpMyAdmin

Link to comment
Share on other sites

"I wanted to use OS X as the server OS because it felt a lot easier to work with than Linux. Database, Email, DNS, and so much more, all in Terminal or GUI, better than using the Web, with managers such as Cpanel and phpMyAdmin"

What? All the server software is CLI driven, linux has the same programs as mac because mac took them from GNU/linux.

There is no cpanel for mac but is for linux, doesn't matter if there was as cpanel is a very expensive software package you wouldn't be using anyway.

There is no reason at all to run a server on mac over linux, there's only one hosting company in the world I know of that does this and that's because they only use mac minis because they're much smaller than 1/2/4/8U servers.

No-ones really going to be able to help you make a mac mini have better performance server-wise because no-one uses them as a server or for anything more than a small home network. They have a GUI which by defaults make them perform badly.

Link to comment
Share on other sites

Even with a whole heap of these old wives tales of 'performance tweaks' you're still going to have to deal with the fact that OS X is hard wired for low latency and responsiveness over throughput. The issues regarding OS X server performance have been known for years - way back in the MySQL benchmarking days where many were wondering why there was such a massive gap when compared to Linux being run on the same hardware. As a small scale server with a dozen or so users infrequently throwing data over the network the performance hit isn't great but beyond the dozen users you might wish to install something like Linux or FreeBSD on it if you really want to squeeze out maximum performance.

Link to comment
Share on other sites

The same server I'm using for my sites is also my desktop because it's all I honestly have at the moment. I so much traffic for my partner to send in that, we'll have to work with what we have until I'm able to get a custom iMac.

Link to comment
Share on other sites

An imac, are you... serious? You want to be a backend web developer... Firstly you choose frameworks over coding your own backends which was a bit meh, then there's questions like this and you STILL want to get a mac to act as a server...

I am gob smacked, I really am, congratulations.

Link to comment
Share on other sites

This is how it goes, people try and do something their way instead of the correct way, usually knowledge is the limiting factor, you fail and learn from your mistakes.

Have fun learning - honestly I mean it. :)

Link to comment
Share on other sites

An imac, are you... serious? You want to be a backend web developer... Firstly you choose frameworks over coding your own backends which was a bit meh, then there's questions like this and you STILL want to get a mac to act as a server...

I am gob smacked, I really am, congratulations.

This is how it goes, people try and do something their way instead of the correct way, usually knowledge is the limiting factor, you fail and learn from your mistakes.

Have fun learning - honestly I mean it. :)

I'm not only a developer. Honestly, do you always expect someone to want something for only one reason? I was a designer before I'm a developer and I have of photography/cinema to work on. Illing Spree is my biggest magazine project to work on and I need a lot of performance.

The framework is of use until I'm able to develop my own from scratch to where it's potential is matched. And hey, me and my partner had the fastest server host gator could possibly offer. The iMac STILL goes beyond that server. What do you recommend? Media Temple's NITRO or HELIX?

Link to comment
Share on other sites

The same server I'm using for my sites is also my desktop because it's all I honestly have at the moment. I so much traffic for my partner to send in that, we'll have to work with what we have until I'm able to get a custom iMac.

In all honesty, if you're trying to run a website that you are expecting to get high traffic from your main work machine on your home internet connection, its not going to work very well. Actually, I'm a little surprised that your ISP left port 80 open. Its often blocked on home internet connections precisely to prevent you from running a website (unless you pay for a business connection, that is).

Also, you should consider learning how to setup and administer a LAMP server if you plan on becoming a proficient back-end web developer. Although doing everything through a GUI seems convenient now, it has its price. There's a reason that most server software is designed to be CLI. Once you understand how the command-line works, you should understand why most sysadmins laugh at the prospect of installing a GUI on a server. If you want to turn your Mac Mini into a dedicated server once you get your new desktop, the Debian Mac Mini Install Guide and Debian LAMP Guide will probably help.

Link to comment
Share on other sites

In all honesty, if you're trying to run a website that you are expecting to get high traffic from your main work machine on your home internet connection, its not going to work very well. Actually, I'm a little surprised that your ISP left port 80 open. Its often blocked on home internet connections precisely to prevent you from running a website (unless you pay for a business connection, that is).

Also, you should consider learning how to setup and administer a LAMP server if you plan on becoming a proficient back-end web developer. Although doing everything through a GUI seems convenient now, it has its price. There's a reason that most server software is designed to be CLI. Once you understand how the command-line works, you should understand why most sysadmins laugh at the prospect of installing a GUI on a server. If you want to turn your Mac Mini into a dedicated server once you get your new desktop, the Debian Mac Mini Install Guide and Debian LAMP Guide will probably help.

In all honesty, if you're trying to run a website that you are expecting to get high traffic from your main work machine on your home internet connection, its not going to work very well. Actually, I'm a little surprised that your ISP left port 80 open. Its often blocked on home internet connections precisely to prevent you from running a website (unless you pay for a business connection, that is).

Also, you should consider learning how to setup and administer a LAMP server if you plan on becoming a proficient back-end web developer. Although doing everything through a GUI seems convenient now, it has its price. There's a reason that most server software is designed to be CLI. Once you understand how the command-line works, you should understand why most sysadmins laugh at the prospect of installing a GUI on a server. If you want to turn your Mac Mini into a dedicated server once you get your new desktop, the Debian Mac Mini Install Guide and Debian LAMP Guide will probably help.

Actually, I upgraded my service to run 101Mbps & open port 80 and 25.

I don't use MAMP or any of the packages because I like making use of all the latest stables individually, to keep track. I'll look about turning this into a dedicated, once I have a second one coming in. (I have a lot going on.)

Link to comment
Share on other sites

Actually, I upgraded my service to run 101Mbps & open port 80 and 25.

Nice!

I don't use MAMP or any of the packages because I like making use of all the latest stables individually, to keep track. I'll look about turning this into a dedicated, once I have a second one coming in. (I have a lot going on.)

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.

ufbm.pdf

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.