speedy33417 Posted May 24, 2008 Share Posted May 24, 2008 I have a database website that I created for my business from scratch. It tracks business appointments, employees, clients, client addresses, payments, reports, etc... Right now it has over 1,5 years worth of data in it. About 400 clients, 600 addresses, 5000 appointments. I don't think it's a large amount of data. I hear people working with millions of rows in their database. I use JOIN statements whenever it's possible. I'm no expert programmer but the site does its purpose for me. I have a goDaddy shared hosting account and lately I've been experiencing that my site is VERY slow. The main appointment page normally displays one week of schedule. It calculates a list of employees who actually have active appointments for the week, then displays a weekly schedule for them. The funny thing is sometimes the page is awful fast, but sometimes it takes 15-20 seconds to load/appear. I'm trying to figure out what to do, because it's just getting really annoying and slows me down when I take appointments over the phone and it takes minutes to find an available spot for the client. Normally there's just only me on the website. At some points there may be up to 4 people on the website. So it's not like there are 100s of people flooding the database server... The website has over 100 pages and I just realized that I don't close down the database connection at the end of page script. Each page starts with opening the db connection, but there is no closing it. Can that create any problems? Can someone recommend anything for me to get rid of the slow load times? If you need more information to give me an answer please ask and I'll try to answer them. Giving access to the site is not an option, though. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/ Share on other sites More sharing options...
bilis_money Posted May 24, 2008 Share Posted May 24, 2008 http://www.whenpenguinsattack.com/2007/04/09/10-tips-for-optimizing-mysql-queries/ or google it... http://www.google.com/search?hl=en&q=%22optimizing+mysql%22&btnG=Google+Search The website has over 100 pages and I just realized that I don't close down the database connection at the end of page script. Each page starts with opening the db connection, but there is no closing it. Can that create any problems? Yes, it affect the server. always close the database connection, it's a good programming habit. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548868 Share on other sites More sharing options...
Darklink Posted May 24, 2008 Share Posted May 24, 2008 You could be on a shared hosting plan. In which case the server load may be being used up by other users on the server. I find it's always the worst idea to go with the most obvious choice for hosting. You should get a plan with people who are dedicated to their hosting only. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548871 Share on other sites More sharing options...
bilis_money Posted May 24, 2008 Share Posted May 24, 2008 or sometimes godaddy server is in maintenance or your isp is in maintenance. there are many factors really. yeah shared hosting is also problematic, but i guess dedicated is expensive. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548875 Share on other sites More sharing options...
jayrich Posted May 24, 2008 Share Posted May 24, 2008 I have to agree with Darklink on this one. The average shared hosting plan will allow you to use a maximum load of about 2% of the cpu. I would definitely do some of bilis_money's tips though - optimizing your queries to reduce the server load will definitely help. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548877 Share on other sites More sharing options...
speedy33417 Posted May 24, 2008 Author Share Posted May 24, 2008 Thanks guys/girls. Exactly what I wasn't sure about. I wasn't sure if it's a hosting issue or a programming issue. I am on a shared hosting plan, of course. It's a budget thing. Btw, is closing the db connection is just good programming habit or does it really speed up the site performance? Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548879 Share on other sites More sharing options...
Darklink Posted May 24, 2008 Share Posted May 24, 2008 It's healthy for MySQL. Not closing it, could end up overloading it on large sites. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548884 Share on other sites More sharing options...
BlueSkyIS Posted May 24, 2008 Share Posted May 24, 2008 i would also ensure that fields which are used in your WHERE clauses are properly indexed. another issue with a shared hosting plan: your database server is probably separate from your web server, meaning your server is connecting to a shared database server in use by dozens (hundreds? thousands?) of other websites. i have pulled all of my clients away from godaddy.com for various reasons. i guess they're okay for a simple website with not-too-much traffic. but i'll never again use them for mission-critical business websites. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548892 Share on other sites More sharing options...
speedy33417 Posted May 24, 2008 Author Share Posted May 24, 2008 bluesky, That's the thing. goDaddy's phpMyAdmin does not offer Foreign Key indexing. Right now my tables only have primary keys. So I imagine that could be part of my problem. Who do you recommend for "mission-critical business websites"? Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548896 Share on other sites More sharing options...
BlueSkyIS Posted May 24, 2008 Share Posted May 24, 2008 not necessarily foreign key indexing, but simple indexing of individual columns in your queries might help. we moved from godaddy.com to superb.net, but they are canadian owned and google seems to know that (if you're concerned about SEO). if you don't care so much about SEO (or at least SEO for USA visitors), i highly recommend superb.net. i require WHM/CPanel for all websites. i won't work with webmin or Plesk because they have caused me many hours of frustrating work to get PHP modifications to 1. work, and 2. stay in place. so we're leasing a server from webcs.com for now. problem with webcs.com: no phone support. Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548916 Share on other sites More sharing options...
speedy33417 Posted May 24, 2008 Author Share Posted May 24, 2008 I've been actually considering to sell the software to other companies. It's a great tool for me and I think it would be worth some money for other companies as well. I am a goDaddy reseller, but I've been looking for another reseller with WHM/cPanel that I'd be happy with. This is exactly why I was trying to figure out why my OWN website is so slow at times. If it's a problem for me, it will be a problem for the companies that I sell the software to. goDaddy is really not the way to go for me. Not to mention that it does not offer Web Host Manager. I need a great (preferably US based) hosting company that offers reseller accounts. I was looking at HostGator maybe? Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548929 Share on other sites More sharing options...
JSHINER Posted May 24, 2008 Share Posted May 24, 2008 I use Sevaa - www.sevaa.com - ask for Randy, tell him I sent you. They have great reseller accounts, great support and great performance. I have a few high traffic sites on shared accounts that never experience any problems. (No, I don't work for Sevaa. Just very happy with their hosting ) Link to comment https://forums.phpfreaks.com/topic/107070-website-too-slow/#findComment-548992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.