How can I achieve efficiency and speed for high traffic web site

2 views
Skip to first unread message

PD

unread,
Mar 22, 2006, 4:30:11 PM3/22/06
to Professional PHP Developers
I am currently making a dating website.

I want to have some information on how to structure the database and
the php files so that I can achieve speed and efficiency.

Can some one please give me suggestions and point me to references
where I can get this information.

Boxxa

unread,
Mar 22, 2006, 5:31:00 PM3/22/06
to Professional PHP Developers
I am working on setting up a dating/profile type site and have been
making each section different tables. Dont making too large of table
for each use. Such as logins are all in one table, personal info is
another, etc. No table has more than 10 fields too.

Just my expierence and seems to be going pretty smooth.

Alex

unread,
Mar 23, 2006, 12:49:56 AM3/23/06
to Professional PHP Developers
Well, it is true that the size of the table will create the most pain,
there are lots of other issues to consider.

For example every time you include a table in an sql statement, mysql
has to get the *whole* of the table and join it up next to the other
table you're linking to. If for example this is a heavily hit members
name/level/member id table, you don't want to do things like keep extra
data in that table as those fields will have to be joined too. Many
people keep all the data together to stop nulls. Instead, a tradeoff
(3rd level) solution would be to have other tables that link together
when needed, not only keeping data private but should speed up the seek
times.

So...

- Split up the data in tables and concentrate on the table that's going
to be hit the most. Get this efficient. Thats why linking tables were
invented i guess!

- Functionalised pages are great. Can be a life saver sometimes. If
you're including or requiring pages in php then depending on where that
page is and little things like the speed of the server/where the
include is kept etc will bog down servers big time, especially if its
doing it every time). Try and keep your includes in a relative
directory. E.g. include("me.inc"); instead of
include_once("http://longtimetolookupbutgoodforstructuredwebsites.com/etc.inc");

yeah?

XHTML is a heathen way of doing things, but doing things right it will
work. I used to just write in tables but its very noticable on slow
servers if you've done it right.

- Another big tip: If you can functionalise it in the page then do it.
I currently have a page that I need to change. It thumbnails a picture
for me using gd. Its currently in its own php page as its quite long
and does its job really nicely. This would be a lot better if it was
included_once in the page I want and then a simple fast memory call
based function is faster than having to retrieve and pretty much
compile a php page for each picture. Something like that can seem
better at the time and you can miss it, but can severly bog down pages.

Generally while loops and structures in your page won't make a
noticable different. I could quote that from somewhere but I can't
remember now, I've read it that many times. The speed of php now and
server that it runs now makes it so it won't matter which methods you
use.

Hope that helped slightly.

Alex

Reply all
Reply to author
Forward
0 new messages