Archive for the ‘Linux/Web Servers’ Category

Benchmarks: JavaScript vs. PHP vs. HPHP vs C++

Just a quick spattering of some benchmarks I ran while testing a program I’m developing internally.

The first three are of the fannkuch benchmark found on the sunspider test site, only ported over to C++ and PHP in addition to the JS version. The browser used for all tests was Firefox 5.

The HPHP listing is a compiled Hip Hop PHP version, which is interesting as it shows the relative difference between it and vanilla PHP.

The last item, Benchmark.php, is the same benchmark file you’ll find in a PHP source download.

See the full benchmarks after the jump!

Read More

Bridge Networking With Virt-Manager In Fedora 15

That titles a mouthful, but we’ve got quite a bit going on here, so let’s get started.

First, what are we up to and why?

In preparation for my Aesop release for Fedora I installed virt-manager on Fedora 15 to create a ‘clean’ Fedora environment. This way I can test to make sure my installation instructions are exactly what they should be for all users.

The problem is as wonderful as virt-manager is it makes networking the host and guest more tricky than I would like. I want something quite simple in theory: to set up a Samba server on the host machine and have the guest easily access it.

All told this isn’t that bad of a process, but the trick seems to be the documentation for doing this is scattered all about. So let’s get started on fixing that : )

Read More

Aesop – A Hip Hop PHP UI

Download the Complete (and free, as in open source free) Aesop + HPHP files from right here.

PHP is my favorite language, bare none. It’s simple, elegant, and fun to use. Problem is, for highly trafficked sites it’s a touch slow and can be quite memory hungry. If you’re Facebook this can lead to problems, which is why they invented Hip Hop PHP (HPHP), a collection of tools and technology that turns our slow and hungry PHP code into lean and mean C++.

Ok, So Just How Fast Is It?

As a quick comparison I created a simple FormBoss form and ran Apache Bench (ab from the command line), to get a sense of the speed difference between Apache 2.2 and HPHP.

The top two tests are when running our simple .php files, the bottom test is when serving a simple 62 byte .xml file with 100 concurrent users:

**It’s important to note these numbers will be lower when running though a network and calling a database. Also, while other servers like Cherokee can be twice as fast as Apache, HPHP is still nearly twice as fast again.

So yes, qualifications aside, HPHP is very fast indeed.

Sure these numbers are fantastic, but using HPHP means compiling the source from scratch and then using a series of command-line switches to run and manage the compiled PHP code.

No longer–In my spare time I’ve created and now released an open-source front-end UI to HPHP.

Read on to learn more, or just download the files!

Read More

HipHop PHP Benchmark

Update: Looking to try HPHP? Take a peek at my open-source HPHP UI.

hip-hop

What are we looking at?

The chart above shows Ubuntu in a 2 and 8 core configuration (the x2 and x8), along with a Server 2008 instance running a benchmark program to stress a PHP based webserver.

What does it mean? The good folks over at FaceBook recently released a custom tool called HopHop that rewrites PHP into native C++ code. The upshot to this, as you can see, is bare-bones PHP code, that is, code which relies on math and loops and such, is much, much faster. Of course other code should be faster as well, though I have yet to benchmark more complex scripts.

Read More

Hosting PHP: Linux vs. Windows Benchmarks

* Benchmarks current as as of 2.17.10

Who’s the fastest: Apache on Windows or Apache on Linux?. In the course of deploying a new web server I thought I’d find out. I play around with APC, Database tuning, and so on. Among other things, in the end we see how with a few simple settings we can increase our servers capacity 2 times over.

Read More

Install Apache, MySQL, and PHP On Fedora

I recently decided to try something new and perform a custom install of an AMP stack on my Fedora 10 box. I configure, build, and install everything by hand. It was an extremely rewarding experience (because it works and you learn a ton about your Linux box), but it took a while.

Read More