I have seen this comparison: http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx
And I would like to know how big a开发者_C百科 website is that can run on SQL Server Express taking into acount that it allows only 1 CPU and its memory utilization is 1 GB?
It Depends. The only answer that can really be given is "as big as can be supported by 1 CPU, 1GB RAM and 10GB max database size", and that really depends on what you're doing.
Immediate show-stoppers would include if you know your DB size will exceed 10GB. If performance is crucial, and you know you have say 2GB of "working set" data/indexes (i.e. commonly/frequently accessed/required) then that will not all fit in the 1GB memory restriction meaning it can't all be cached (therefore increasing IO, which is costly and will affect performance).
See this MSDN reference on estimating database size - read through that and you can estimate what your database size may be. But that's just one aspect - there is no "you could support 1000 users and 1000000 posts" type answer I'm afraid, as it really completely depends on how the forum is accessed, peak loads, what data will be stored, how much of it...etc etc.
SQL Server 2008 Express can support a forum of this size:
- 250m total users
- 100 simultaneous logged in, active users
- Average click/post rate of 1-2 per second per active user
- Max post size of 6k-8k chars, English language only
- Max 800k total unarchived posts
This complete and utter W.A.G. is based on these rough figures:
- Various web references citing SQL Server Express hitting at least 400 transactions / second
- ~3-4 DB calls per user request
- ~80% of the DB's storage goes to posts
- Sticking with ye olde VARCHAR across the wire
- Max posts = ~(80% of 10GB) / (8.5kB post size + post overhead (including threads))
And these assumptions:
- Your forum doesn't have a lot of "compute heavy" features
- You have decent hardware (i.e., not the junk P4 w/ 512MB rotting in the closet)
- The DB server is separate from the web server
- You have at least semi-effective caching
- You serve static content off the web server, not from the DB
- You use (and hang onto) prepared statements
- You use sql parameters instead of concatenating in your query arguments
- You avoid making multiple micro DB calls per user request
- You have appropriate indexing and statistics
- You have a straightforward, OLTP-friendly DB design
- You're mindful of where's the right place to perform calculations on the data sets
BTW, just because I do have a "you could support 1000 users and 1000000 posts" answer doesn't mean AdaTheDev is wrong. He's right, as is everyone else who says you can't be at all precise. There are many, many factors involved in this. In fact, most devs probably won't be able to get this much out of the DB because they'll do something worse than advised in the above assumptions. (While other devs will be able to do quite a bit better than I've stated.)
I think it's wise to not depend on a guestimate like this. I mean, it's practically an opinion and certainly can't be proven before trying it out. There are too many variables, too many scenarios, YMMV, etc. You should have a plan for handling growth anyway, like when's the right time to upgrade to SQL Server Standard, or when/how to introduce additional Express instances.
However, the numbers do help you get a ball park idea. If pressed, I'd feel good saying Express could probably handle, say, TechReport.com's forum (with archiving) but probably not Anandtech.com's.
精彩评论