3 ms·
It uses Clickhouse, though, which should be xtremelly fast for this.
by majkinetor 2y ago
It uses Clickhouse, though, which should be xtremelly fast for this.
- that_guy_iain 2y agoYes. But PHP still needs to process it before it goes to Clickhouse. PHP is the bottleneck.
- wiseowise 2y ago[flagged]
- axelthegerman 2y agoIf that "bottleneck" is thousands of requests per second then it doesn't really matter for smaller deployments does it? (Which seems to be the target audience and not FAANG) I'm not a big fan when folks call out languages as bottlenecks when they have no proof on the actual overhead and how much faster it would be in another language.
- that_guy_iain 2y agoTo tweak a PHP deployment to handle hundreds of requests per second which is very very realistic for a basic logging for a mid-sized application you're looking at having a very beefy server setup. Most PHP deployments barely reach a hundred per server. And this is an open source project is should be designed to handle basic production workloads which it could but it'll cost you a bunch more than if you used the correct languages. > I'm not a big fan when folks call out languages as bottlenecks when they have no proof on the actual overhead and how much faster it would be in another language. Honestly, I thought it was so obvious that an interpreted language is not good for high throughput endpoints that it didn't need to be proven. I also thought it was obvious that a logging system is going to handle lots and lots of data. It could be easily proven by doing a bunch of work but obviously there is no point in me proving it.
- withinboredom 2y agoI rebuilt durable-functions in php. Durable Functions is a C# actor model runtime. My PHP implementation meets or exceeds the same benchmarks as the C# version. > It could be easily proven by doing a bunch of work but obviously there is no point in me proving it. Because you cannot prove it... :) I wrote this post a few years ago, that actually spurned some improvements in C# ... so here you go: https://withinboredom.info/2022/03/16/yes-php-is-faster-than-c/ https://withinboredom.info/2022/03/16/yes-php-is-faster-than...
- that_guy_iain 2y agoNo, it's because I've got productive things to do that do benchmarks that have already been done repeatedly. The only way to get PHP to the same speed as compiled languages for web requests is to use experimental tooling. I notice your benchmarks are over 10 runs?! That's not a good sample size. And even more importantly, it's not in the same context. Sure once you compile PHP and have it running it'll run fast. But PHP has a very specific usage which is web applications. It's been well-known for years that PHP's performance issues are related to the fact it's an interpreted language that has to be interpreted everytime but if you compile and run repeatedly it can perform extremely well. Which is why every performance related PHP nerd is working on experimental tools to do that.
- mrngm 2y agoI'm sure you've heard of PHP's opcache by now. That's not experimental and actually caches the interpreted code in memory for faster subsequent execution.
- withinboredom 2y agoYes, and in 8.4, uses an actual IR for machine code generation and is pretty cool!
- that_guy_iain 2y agoYes, it makes it faster but does not deal with the core performance issues which is why Roadrunner, Frankenphp, etc exist.
- robocat 2y agoAre you sure PHP is the bottleneck? The author writes that Clickhouse takes 0.1s for an example request: https://news.ycombinator.com/item?id=42666703 https://news.ycombinator.com/item?id=42666703 PHP would need to be adding 0.1s CPU time for processing the request for the PHP code to become the bottleneck. That seems unlikely.
- thunky 2y agoThat 0.1s is to write 4k rows to clickhouse, not per (log write) request.