HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
zynga
zperfmon
PHP2013–2013
zynga / zperfmon · Archived

zperfmon

[DEPRECATED] zPerfmon

3Distinct people
4Mentions
0Explicit recommenders
418GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

[DEPRECATED] zPerfmon

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by week4 dated mentions

Observed mentions: 2013-08-05 07:09:28 UTC to 2013-11-12 16:06:44 UTC. Weeks start Monday, UTC.

0122013-08-05 00:00:00 UTC to 2013-08-12 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 commentsAug 52013-08-12 00:00:00 UTC to 2013-08-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-08-19 00:00:00 UTC to 2013-08-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-08-26 00:00:00 UTC to 2013-09-02 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-09-02 00:00:00 UTC to 2013-09-09 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-09-09 00:00:00 UTC to 2013-09-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-09-16 00:00:00 UTC to 2013-09-23 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-09-23 00:00:00 UTC to 2013-09-30 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 232013-09-30 00:00:00 UTC to 2013-10-07 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-10-07 00:00:00 UTC to 2013-10-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-10-14 00:00:00 UTC to 2013-10-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-10-21 00:00:00 UTC to 2013-10-28 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-10-28 00:00:00 UTC to 2013-11-04 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-11-04 00:00:00 UTC to 2013-11-11 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2013-11-11 00:00:00 UTC to 2013-11-18 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsNov 11

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Aug 52013-08-05 00:00:00 UTC2013-08-12 00:00:00 UTC211
Aug 122013-08-12 00:00:00 UTC2013-08-19 00:00:00 UTC000
Aug 192013-08-19 00:00:00 UTC2013-08-26 00:00:00 UTC000
Aug 262013-08-26 00:00:00 UTC2013-09-02 00:00:00 UTC000
Sep 22013-09-02 00:00:00 UTC2013-09-09 00:00:00 UTC000
Sep 92013-09-09 00:00:00 UTC2013-09-16 00:00:00 UTC000
Sep 162013-09-16 00:00:00 UTC2013-09-23 00:00:00 UTC000
Sep 232013-09-23 00:00:00 UTC2013-09-30 00:00:00 UTC000
Sep 302013-09-30 00:00:00 UTC2013-10-07 00:00:00 UTC000
Oct 72013-10-07 00:00:00 UTC2013-10-14 00:00:00 UTC000
Oct 142013-10-14 00:00:00 UTC2013-10-21 00:00:00 UTC000
Oct 212013-10-21 00:00:00 UTC2013-10-28 00:00:00 UTC000
Oct 282013-10-28 00:00:00 UTC2013-11-04 00:00:00 UTC000
Nov 42013-11-04 00:00:00 UTC2013-11-11 00:00:00 UTC000
Nov 112013-11-11 00:00:00 UTC2013-11-18 00:00:00 UTC202

What Hacker News says

4 sources
A lot of extensions expose async modes, use them. On the extension APIs curl-multi - http://php.net/manual/en/function.curl-multi-select.php memcached-getdelayed - http://us2.php.net/manual/en/memcached.getdelayed.php mysqli-reap_async - http://us2.php.net/manual/en/mysqli.reap-async-query.php postgres-send_query - http://www.php.net/manual/en/function.pg-send-query.php gearman doBackground - http://www.php.net/manual/en/gearmanclient.dobackground.php Something like gearman queues basically take the asynchronous processing out of the web layer into a different daemon. There were things like S3 uploads and fb API calls which were shoved into gearman tasks instead of holding up the web page. Some of the stuff is very design oriented, for instance in most of my memcache code, there are no mc-lock calls at all - all of them are mc-cas calls.
Read the rest
A lot of the atomicity is done by using add/delete/cas which involve no sleep timeouts. A bit of it was done using atomic append, increment and decrement as well. SQL queries are another place where PHP doing actual work sucks for the web apps. A bunch of the mysql/postgresql functionality within a lock is actually moved onto stored procedures, instead of being driven by PHP. https://github.com/zynga/zperfmon/blob/master/server/schemas... So the code above is horribly written because you can't parameterize table names or column names in PL/SQL. But that essentially cuts down the involvement PHP has with the backend's locked sections. Also a lot of the stats data was flooded onto apache log files instead of being written out from the PHP code directly using an fwrite. https://github.com/zynga/zperfmon/blob/master/client/zperfmo... This uses apache_note() function in PHP to log stuff after the request is done & the connections are closed. That gets into the log files as %(<name)n fields in the access log. You can see there that every single access log has an associated user, the HMAC of the request and peak memory usage. All collected at zero latency to the actual HTTP call. The thing to avoid though is pcntl - it absolutely messes up all of apache/fastcgi process management code. This is not all of what I've done. I am sorry to say some of my best work in this hasn't been open-sourced & has perhaps been killed since I left Zynga. PHP backends I built using these methods were handling approx ~6-7 million users a day on 9 web servers (well, we kept 16 running - 8 on each UPS). Ah, fun times indeed - too bad I didn't make any real money out of all that.
In Benchmarking Codswallop: Node.js vs. PHP
Long term php guy (I maintained APC for years, slowly given up now), so I've worked a lot with ~2k/3k request-per-second PHP websites. The real trick here is async processing. A lot of the slow bits of PHP code is people not writing async data patterns. If you use synchronous calls in PHP - mc::get or mysql or curl calls, then PHP absolutely sucks in performance. Nodejs automatically trains you around this with a massive use of callbacks for everything. That is the canonical way to do things - while in PHP blocking single-threaded calls is what everyone uses. The most satifying way to actually get PHP to perform well is to use async PHP with a Future result implementation. To be able to do a get() on a future result was the only sane way to mix async data flows with PHP. For instance, I had a curl implementation which fetched multiple htt
Read the rest
p requests in parallel and essentially lets the UI wait for each webservices call at the html block where it was needed. https://github.com/zynga/zperfmon/blob/master/server/web_ui/... There was a similar Memcache async implementation, particularly for the cache writebacks (memcache NOREPLY). Memcache multi-get calls to batch together key fetches and so on. The real issue is that this is engineering work on top of the language instead of being built into the "one true way". So often, I would have to dig in and rewrite massive chunks of PHP code to hide latencies and get near the absolute packet limits of the machines - getting closer to the ~3500 to 4000 requests per-second on a 16 core machine (sigh, all of that might be dead & bit-rotting now).
In Benchmarking Codswallop: Node.js vs. PHP

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.