Yaconf loads your config at PHP startup into immutable, memory-resident structures — no per-request parsing, near-zero copying, and config kept out of your codebase. A tour of its two-method API, ini format (arrays, maps, sections, inheritance) and options.
with 0 CommentA stream-of-consciousness debug log: a valgrind 'invalid free' in __libc_freeres that turned out to have nothing to do with our code. I never found the true root cause, only a minimal reproduction, a workaround, and a hypothesis. Hope someone who knows glibc can set me straight.
with 0 CommentOn CentOS, setting a libcurl timeout below 1000ms makes curl return CURLRESOLV_TIMEDOUT without sending any request — because SIGALARM-based DNS timeouts have only one-second resolution. Setting CURLOPT_NOSIGNAL bypasses it; building libcurl with c-ares avoids the tradeoff entirely.
with 0 CommentSlides from a talk I gave in Shanghai this past June, covering a year of Weibo work — changes to Yaf, plus new tools like Yar and Yac. The overall approach (speed up first, cut costs, clarify the architecture, SOA) more than halved Weibo's homepage response time while lowering overall costs.
with 0 Commentphp-valgrind is a small PHP extension that lets you toggle Callgrind profiling from inside a PHP script — using CALLGRIND_TOGGLE_COLLECT — so you can profile a specific code segment and see which underlying functions and syscalls it triggers.
with 0 Comment