Live data from Hacker News

Scaling PHP Book: I will teach you to scale PHP to millions of users

scalingphpbook.com

61–70 of 105 posts

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#61
post #38

Here's a short list: 1. Cache the output at the edges: Use Varnish or other reverse proxy cache. 2. Cache byte code: Use APC or XCache PHP opcode cache. 3. Cache and minimize database I/O: reduce database touches using memcached, redis, file caches, and application-level caches (ie. global vars) 4. Do event logging in local files, not to the database: Make all write operations as simple and fast as possible, any data…

I'm curious why you suggest avoiding ORMs. I've been debating this for a while and while I like the accessibility and abstraction that ORMs provide in Django and Rails I'm not familiar enough with Doctrine, DB_DataObject or the other PHP options to really have formed my own opinions yet.

Is this a language specific suggestion or something broader? I would love to hear a deeper debate on the subject.

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#62
post #44

This fetishism with scaling... to me it's just procrastination. It feels like work because you're doing something technical but, in the end, you're adding very little to your product. Yesterday I had a meeting with a potential customer and I hated it. I hate to try to explain my SaaS software to non-technical people who treat me like some 17-year-old webmaster. I'd much rather be refactoring Clojure code. But I got o…

> It's 2012 for god's sake, you can rent a 32GB server for less than $100. Where, in the US, can I rent a 32GB server for less than $100?

Hetzner[1]. I never said "in the US", but even in the US you can get a pretty good deal: 16GB for $79/month[2].

[1] http://www.hetzner.de/en/hosting/produkte_rootserver/ex4s

[2] http://www.honelive.com/xml/#new-york-city-dedicated-servers

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#63
post #8

Good to know other people want to share about successful scaling with PHP. On the downside, I have a book cooking on the same exact subject, with release planned September (self-publish, about 80% done), but now not sure if it's worth continuing. [edit]Slight moment of "panic", as seeing someone else releasing a book on the same subject made me sad, but you're right, no reason not to continue.

What are you waiting for?

Go with http://leanpub.com - publish it and then complete it.

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#64
post #44

This fetishism with scaling... to me it's just procrastination. It feels like work because you're doing something technical but, in the end, you're adding very little to your product. Yesterday I had a meeting with a potential customer and I hated it. I hate to try to explain my SaaS software to non-technical people who treat me like some 17-year-old webmaster. I'd much rather be refactoring Clojure code. But I got o…

What is a 32GB server?

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#65
post #44

This fetishism with scaling... to me it's just procrastination. It feels like work because you're doing something technical but, in the end, you're adding very little to your product. Yesterday I had a meeting with a potential customer and I hated it. I hate to try to explain my SaaS software to non-technical people who treat me like some 17-year-old webmaster. I'd much rather be refactoring Clojure code. But I got o…

scale is one of those problems that sneaks up on you (well unless you're an instant hit site I suppose)

In all of my cases dealing with scale issues it's been due to the DB growing very large in size to the point where you can't use the same techniques that you're used to using. That usually happens in combination with more concurrent users. Depending on how large and how organized your code is, things can get very ugly when the site starts throwing errors, being unresponsive, etc.

I usually know where I want to go as a next step with scaling and monitor our resource usage until it gets pretty high. Then we take the next step. But we don't spend a huge amount of time scaling until we know we need it.

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#66
post #62

Earlier quoted context omitted.

> It's 2012 for god's sake, you can rent a 32GB server for less than $100. Where, in the US, can I rent a 32GB server for less than $100?

Hetzner[1]. I never said "in the US", but even in the US you can get a pretty good deal: 16GB for $79/month[2]. [1] http://www.hetzner.de/en/hosting/produkte_rootserver/ex4s [2] http://www.honelive.com/xml/#new-york-city-dedicated-servers

No, you didn't, but we all knew you were talking about Hetzner. One company, selling consumer-grade desktop parts unfit for use in a production server, in one country, does not lend credibility to statements like you made. Neither does the NYC site with no info, no SLA, and again, desktop parts. It's something like saying salary isn't important to startups because labor costs in China are pennies per hour.

It's 2012 for god's sake, and 32GB RAM servers are still hundreds of dollars a month to rent from any first class data center.

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#67
post #61
post #38

Here's a short list: 1. Cache the output at the edges: Use Varnish or other reverse proxy cache. 2. Cache byte code: Use APC or XCache PHP opcode cache. 3. Cache and minimize database I/O: reduce database touches using memcached, redis, file caches, and application-level caches (ie. global vars) 4. Do event logging in local files, not to the database: Make all write operations as simple and fast as possible, any data…

I'm curious why you suggest avoiding ORMs. I've been debating this for a while and while I like the accessibility and abstraction that ORMs provide in Django and Rails I'm not familiar enough with Doctrine, DB_DataObject or the other PHP options to really have formed my own opinions yet. Is this a language specific suggestion or something broader? I would love to hear a deeper debate on the subject.

Personally, one of my favourite discussions is Laurie Voss' "ORM is an anti-pattern": http://seldo.com/weblog/2011/08/11/orm_is_an_antipattern

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#68
post #62

Earlier quoted context omitted.

Hetzner[1]. I never said "in the US", but even in the US you can get a pretty good deal: 16GB for $79/month[2]. [1] http://www.hetzner.de/en/hosting/produkte_rootserver/ex4s [2] http://www.honelive.com/xml/#new-york-city-dedicated-servers

No, you didn't, but we all knew you were talking about Hetzner. One company, selling consumer-grade desktop parts unfit for use in a production server, in one country, does not lend credibility to statements like you made. Neither does the NYC site with no info, no SLA, and again, desktop parts. It's something like saying salary isn't important to startups because labor costs in China are pennies per hour. It's 2012…

This is a bit of a tangent, but do you have any sources for consumer-grade desktop parts being lower quality than enterprise-grade? I'd like to read an in-depth hardware analysis that describes circuit board design, capacitor sourcing, etc.

I'm really curious to see how different equivalently priced ASUS and supermicro boards differ.

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#69
post #68

Earlier quoted context omitted.

No, you didn't, but we all knew you were talking about Hetzner. One company, selling consumer-grade desktop parts unfit for use in a production server, in one country, does not lend credibility to statements like you made. Neither does the NYC site with no info, no SLA, and again, desktop parts. It's something like saying salary isn't important to startups because labor costs in China are pennies per hour. It's 2012…

This is a bit of a tangent, but do you have any sources for consumer-grade desktop parts being lower quality than enterprise-grade? I'd like to read an in-depth hardware analysis that describes circuit board design, capacitor sourcing, etc. I'm really curious to see how different equivalently priced ASUS and supermicro boards differ.

Read the comments here: http://news.ycombinator.com/item?id=4063592

Re: Scaling PHP Book: I will teach you to scale PHP to millions of users

#70
post #44

This fetishism with scaling... to me it's just procrastination. It feels like work because you're doing something technical but, in the end, you're adding very little to your product. Yesterday I had a meeting with a potential customer and I hated it. I hate to try to explain my SaaS software to non-technical people who treat me like some 17-year-old webmaster. I'd much rather be refactoring Clojure code. But I got o…

You're worried about people caring about scaling? What about the rampant PHP addiction? Focus on the real problem!
Post reply on HN