I am writing a web application, that should work with 1000 requests/second using Apache and MySQL. On my server I have Ubuntu installed. Can my application be faster if I install FreeBSD instead of Ubuntu?
Thanks.
I am writing a web application, that should work with 1000 requests/second using Apache and MySQL. On my server I have Ubuntu installed. Can my application be faster if I install FreeBSD instead of Ubuntu?
Thanks.
The difference between various *nix distros in speed is minimal. I would suggest you use nginx instead of Apache. That might really save your day :)
When optimizing for performance, the selection of OS or Linux flavour matters the least.
On the hardware side, your kind of workload probably is happy if the server has plenty of RAM, say 8 or 16 GB. Of course the network connection should be fast, too.
First cover your back by making sure you have at least semi-sane settings for your Apache, PHP and MySQL. What are those, that's hard to tell by your two and a half line long question, considering there are books written about this topic. Actually, a separate book for each of the pieces of software above. Also consider replacing Apache with lighttpd or nginx unless you have some specific reason for Apache.
Then make sure your application doesn't have typical deadly sins, such as lack of caching, non-optimal or unnecessary SQL queries, fetching some resource from 3rd party server each page load, rendering some thumbnails from an original picture over and over again each page load, lack of SQL indexes, and so on.
When you are confident you have everything set up right, benchmark your server with Apache Benchmark, JMeter, Siege or plethora of other available tools. See if your server can handle the load. If not, go back to drawing board and figure out why.
Finally, when it comes to OS, it's not about what the OS is (at least when pondering between *BSD/Linux), but how it's tuned. Carefully choose the file system for your use; if you have lots and lots of small files, ext4 might not be the best choice in Linux, for example. On the other hand, the default kernel settings in typical distributions are fine for most workloads, but in more exotic environments things like I/O elevator, shared memory settings, or network parameters might have to be tuned. If you really need to enter this stage, congratulate yourself about a popular service and/or start thinking about getting more servers.
As far as your OS is based on Linux/Unix, then no problem.just OS should be TUNED properly and very carefully. the real thing is the performance tuning of Apache and MySQL. and you will surely require a load balancer to entertain 1000 requests/sec. or on the other hand, you can use a very heavy hardware with huge memory and CPU to accommodate everything on same machine. the things you should be concerned is - Careful balancing of Load - Performance tuning of Apache - performance tuning of MySQL (and as well separation of MySQL from Apache server)
First off, BSD is not linux, but that's ok. BSD distros are typically faster than linux, but not enough for you to stress about it. But the fact of the matter is that your operating system is a very small factor in throughput (crappy OSs excepted).
Operating system, web server, database flavor, and programming language will have an insignificant impact on throughput in comparison to hardware. The only notable factor will be the guts in your server. Buy more ram, more cores and faster processors. That will speed things up.
But beyond that, if you are buying your own server, it is probably on your home connection. If you put this on a standard dsl line it is unlikely you could pump out more than 100 RPS. Just be a peach and buy web hosting somewhere that has fast connection to the interblag.
You could also go with ArchLinux, which is about as bare-bones as you can possibly get in a Linux distro.
As other people have already answered, there is typically not really any appreciable difference in speed between distributions; what matters is your configuration and the amount of processes running. That said, Arch is a good choice because you are in control of absolutely everything; you can be sure nothing else will slow down your server without your knowledge.
Besides the distribution, you need to analyze your application flow. Apache has a big footprint and can't serve as many simultaneous connections as some of its single-threaded peers (e.g., nginx, lighttpd), but it is the only good choice for a number of apps. If your pages are well-cached, you're using bytecode optimization, and your query time is low, there's no reason why it couldn't handle 1000 concurrent connections.
But if you're doing any kind of non-trivial processing, you will need to either start thinking about more efficient web servers, or clustering 2 or more Apache servers together in a load-balanced setup.