Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have read through multiple questions here on StackExchange that concern WordPress scaling and the common opinion is that WordPress is indeed highly scalable provided you have the infrastructure to support it. However, all opinions point and talk about the database scaling.

However, I must ask out of curiosity as to how scalable is the WordPress code? I find numerous places within the code where User IDs or Post IDs are cast as integers. Now, PHP puts limitation on range of integers to -2147483648 to 2147483647(signed) for 32 bit and 9223372036854775807 for 64 bit. Thus limiting the code to work in that range. So if you happen to have a Post ID or a User ID of 100000000000000 it shall be converted to 2147483647 on 32 bit systems. And a similarly on 64 bit. Effectively, limiting the system.

So, though the database allows for scaling, the code limits the same. I may be entirely wrong with my assumptions, if so I'd like to be educated on the same. And if otherwise, how do we scale the code? Or are claims of WordPress scalability false? Also what are other possibilities where the code could be limiting the scalability?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

If INT is set to UNSIGNED, allowing only non-negative integers, your value range is from 0 to 4294967295.

Thats...

4,294,967,295 (4 billion +).

...for the given table. Just to put things into perspective.

Only through poor management and unnecessary incrementation would you exhaust that range, say for your posts table as an example.

That said if you have some unique requirement that uses that entire range for a table then simply create another. WordPress allows for that.

There's also the possibility for multiple DBs (http://codex.wordpress.org/HyperDB) being one example.

If you're pushing the upper limits of a standard table primary key, then you would already be scaling your application beyond the traditional single table schema to handle such quantities of content.

Notice how I said application and not blog? At this point, its likely that your site resembles nothing like the common blog does and instead is much more an application, a data management system.

share|improve this answer
    
Thx for the reply. Well, PHP does not support unsigned int per my knowledge. However, considering the fact that you've mentioned splitting the DB, how does WordPress handle the split data? After exhausting the primary keys in User table does WordPress automatically start creating users in the new table in new DB, provided HyperDB is all set? I am unable to get my thought around this. –  John Sep 27 '12 at 19:48
    
If PHP encounters INT beyond its limit, it converts to FLOAT and you continue on your merry way. So from what I understand there's no limitation with WordPress <-> PHP <-> MySQL in the sense we're talking about. Refer to HyperDB's FAQ - automation is always possible, but its not without your design. –  userabuser Sep 27 '12 at 20:50
    
Thx for clarifying things! Accepted your answer. –  John Sep 27 '12 at 21:26
    
No probs. As a side note, this slide presentation How to kill MySQL Performance - although a high level view, is quite interesting and useful in that in builds on this topic of scalability. You might find some useful advice that you can implement as part of your strategy. Good luck. –  userabuser Sep 27 '12 at 21:47

As cool as infinite scalability would be, it is not really necessary to code into most projects.

That limit of 100000000000000 is high enough that you could run a single WordPress Network for all the inhabitants dyson ring 1000 km wide at Earth's orbit with current population density to still have 7 accounts each. Or in another way thats about 15000 posts per person if everyone on Earth used your site.

I believe that WordPress core and most other software will have some major work on the networking side before a single server can be shared across several colony worlds.

share|improve this answer
    
I agree to your point. However, I am trying to get to understand this whole scalability thing and whether the code can be a limiting factor. My understanding of your answer has been that, both the DB and the code would scale graciously without one bottlenecking the other. –  John Sep 27 '12 at 19:58
    
Best. Answer. Ever. –  Brian Fegter Oct 5 '12 at 3:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.