flat-file forums

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
generalm10
Forum Newbie
Posts: 4
Joined: Wed Apr 24, 2002 1:05 am

flat-file forums

Post by generalm10 »

I have some questions about flat-file databasing for forums.
The website we are creating will allow our users to create their own forums, using software that we have written in PHP. Each forum will be given its own sub-domain and directory. Our software right now just parses tiny text files, one for each topic inside forum folders, so they never get very big but have the capability to become numerous.

Would, say, 1000 of these forums running on a shared server bog down the server resources? How can we test this and see if our software is stressful on the server? Is there a way to see how much information is being processed when a script is run? Is there a more effecient way of databasing this?

Thanks - Alex B.
User avatar
Ruiser
Forum Newbie
Posts: 8
Joined: Wed Apr 24, 2002 11:04 pm
Contact:

Post by Ruiser »

You could start by storing the data in a real database. PHP has great support built in for many databases, including free ones such as MySQL and PostgreSQL. The people who made those databases have put a lot of effort into making them faster and easier to use than regular flat files. This would help performance greatly.

As far as load testing, you need to build your applications first. There are a few free tools that you can have run queries against your website. They'll just pound the heck out of it and give you a report about how many users you will be able to handle at once and so on. check out http://www.freshmeat.net and do a search for load testing.[/url]
generalm10
Forum Newbie
Posts: 4
Joined: Wed Apr 24, 2002 1:05 am

okay

Post by generalm10 »

so you think it would be safe to store multiple forums' data in one mysql database? im talking about hundreds, maybe thousands of message boards running from the same database. would this slow things down?
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

It really also depends on the activity.

I can have a 1000 forums running.....and no activity. You need to consider what load you will have.

The best answer would be something hardware wise. You keep about 150 forums on each server, and get a new server for every so many people.

In fact, you could have a web server, a file server, and a database server.
Need more speed, throw another server into the loop, and let it handle the load.

This, of course, is something you should talk to your sysadmin about.
generalm10
Forum Newbie
Posts: 4
Joined: Wed Apr 24, 2002 1:05 am

Post by generalm10 »

There is no way that we have the budget to get a new server for every 150 forums, and I don't think that is necessary in terms of activity, but what I'm concerned about is how many forums (with light activity) I can pack into one database? Does the number really matter in terms of mysql?
User avatar
Ruiser
Forum Newbie
Posts: 8
Joined: Wed Apr 24, 2002 11:04 pm
Contact:

Post by Ruiser »

It's definately possible to store multiple forums' data in the same database as long as you design the database correctly. It's actually the way I would recommend. You can load balance database servers later when you have more of a budget for more hardware if you design it with this method. If the forums are small, you could fit quite a few on the same server. You just have to see what your load is like when you get there, or if you have a good idea now, it shouldn't be to hard to calculate.
generalm10
Forum Newbie
Posts: 4
Joined: Wed Apr 24, 2002 1:05 am

Post by generalm10 »

interesting - is there an easy way to find out how much load im putting on the server?
User avatar
Ruiser
Forum Newbie
Posts: 8
Joined: Wed Apr 24, 2002 11:04 pm
Contact:

Post by Ruiser »

When you get your software finished, go to freshmeat.net and do a search for load testing. there are some free programs that will hammer your webserver, php scripts, and database and give you a report of how many users can use the system at once, etc.
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Post by MattSharp »

Is your site goign to consist of 1000 forums? Or like just 1000 different sections. By sections I mean like on here where we have PHP, mySQL and stuff. By whole forums I mean like this whole forums directory?
DubWise
Forum Newbie
Posts: 1
Joined: Thu Nov 30, 2006 12:29 pm

The solution?

Post by DubWise »

Did anyone ever come up with a clear solution to this question? For a website with 1000 small individual forums, would it be better to use a flat file solution or a single database? Thanks!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Next time, could you maybe post a new thread with a link to the old thread so we don't bring back threads that have been dormant for 5 years and 7 months?

Based on the thread, there was no solution offered other than trying to database them. It would be my recommendation as well, as there is no reason to overload the filesystem with that many hits to the files. This is just my opinion.

EDIT | Man, I really need to start looking at dates better. Seeing as this thread has been dead for quite some time, I am going to lock it. Contact a mod to unlock it if you think there is sufficient reason to have it unlocked.
Locked