That UDID script I wrote - 350K hits... (w/source)
blog.maclawran.ca
blog.maclawran.ca
If you worry about UDIDs being tracked I guess you should worry about the http to his page too.
However, according to somebody who apparently tested it a year ago (and posted it on HN), half of the iPhone apps pass UDID over the same http, allowing collection of the very same or similar data.
Which makes the whole subject of a government agency having UDID database without other convenient data, ummm, quite less probable. IMHO most of the "business entities" are able to collect much more than presented here.
If he had 100 requests in one second (average is 8/ps over 12 hours), that's 300kb per second transfer rate.
1gb of data transfer for a single day is relatively small. Server upload rates of <1mbps is also small.
If we make the page 100kb in size now, for example with a few nice images 350k hits turns to 34gb of data transfer. 100 requests in one second would require a 10mbps transfer rate. A $15p/m host likely wouldn't be able to cope with this.
> I think the combination of Lighttpd+php5-fpm is underappreciated...
So for me the real reason the site stayed up was not because he picked PHP or any other technology, but because the page was barebones and didn't put any strain on the server at all. Page file size is an underappreciated advantage for websites!
Considering that lots of peoples blogs die because they get 10k visitors from HN. His small $15 vps did fine.
Never seen $found = `grep $udid FILE` using back-ticks in PHP land. Is that the same as the exec() function?
It's still relatively unsafe, as it invokes external programs through a shell, so you're dependent on the shell's environment, which can diverge on different systems. Last I checked, PHP did not have an easy, obvious way to safely invoke another program. You can do it manually with a mix of pcntl_fork and pcntl_exec, but capturing the output using that is more difficult.
Is there any shell on which those functions are unsafe ? I think they assume cmd.exe on windows and sh on others.
The right thing to do is provide an output capturing API that does not require escaping because it takes a list of strings passed to the exec(2) system call.
Just for comparison, in 1998/99 I ran an mp3 search engine that handled 200k daily queries at the peak. It was a Pentium with 128MB of memory. The search server was written in C, and it used an inverted index. The system load rarely went over 1.
Anyway, that was an EC2 Micro running PHP-FPM on Nginx, and it stayed up without problems through millions of hits over a few days as well. It's easy to write a well-scaling single-function site like that.
Yet a lot of blogs and more complex sites die instantly when they cross a couple of dozen hits per second. I suspect there are multiple reasons for it, but the most egregious one coming to mind is the typical PHP setup within shared hosting environments where every single request means about 30 file compilations and a lot of DB requests. Caching is probably not very popular either.
EDIT: Re-reading, that sounds a little bitchy.. I didn't mean it that way. Sorry
Perhaps it needs commenting? Could be formatted more nicely? I'm truly interested in your characterization because I'm just not seeing it.
The OP is praising the performance of lighttpd + php5-fpm, but the script actually spawns an external process to search for the UUID. That's like running an old GGI that needs to be executed with every request.
I may be wrong but using lighttpd and php5-fpm (with fastcgi) may not be as relevant as it seems. I'd say that the operating system is caching everything.
EDIT: yes, php-fom is "a simple and robust FastCGI Process Manager for PHP". I'm no doing much PHP lately!
When the system begins to show signs of stress, you look at where it's spending its time, then alleviate the bottleneck.
When I first visited the site, before he started putting more text on the page, I don't think I would have run into the issue.
Browser window isn't maximized; if I scroll all the way up it cuts off the last two paragraphs/sentences (link to his wife's blog and the results).
Otherwise it's simple; it doesn't need to be flashy when it's a one-stop site (unless they release the remaining ones).
I also had a blog post hit the front page of Reddit as well as Gizmodo. ~400K hits over 24 hours. Page size was roughly 700KB in size. All hosted on a shared hosting plan at HostGator.
How? A free CloudFlare account to cache every image/css/js resource on the page, plus a custom page rule to force cashing of the actual html response from the server.
Did I think my situation was impressive? Not really. Just an average number of pageviews for a front page article.