• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ General Support (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Large number of Site/SQL "hits"

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Large number of Site/SQL "hits"

Postby Ranzid » Thu Sep 27, 2012 5:16 pm

ok im still very rusty with all this php/sql/ajax business so please concider me a n00b .. last time I did web design frames were all the rage.. :/ yea

anyway so Ive setup a PFC on my website but last night when I had only 15 users on chat my hosting which I thought was unlimited temporarily shut the site down due to to many SQL database queries as their maximum ive now learned is 50,000 per hour , also upon checking the stats my site had over 340,000 "hits" out of a limit of 500,000 , now 90% of both the hits were created in 1 day from the new 15 users and it killed chat in around 30 minutes.

so id rather post here and be told its something simple and ive been stupid that to slave over it trying to save face , so heres my questions:

looking at purely the SQL , is there a way to reduce the ammount of queries thrown at the SQL database? and how many queries should it be generating with 15 users?

Im still un-sure as to what "site hits" actually are .. are they simply a per click thing? or per every html interaction? so really what im asking is could it be chat that is creating these large numbers or the forums?

PFC is currently linked into the PHPBB3 boards usernames so we can have auto-mods and names etc could this account for the high SQL and site hits?

The ping function on PFC updates quite regularly could that add to things?

and finally .. just a general help.. the chat was put up to handle up to 50 users which I know is alot but if I cant even have 15 without killing the site then ill have to move to a new chat system.. probably and quite depressingly a java one, so any ideas are more than welcome.

thanks in advance for any replys and im sorry if there was something similar on this but I couldnt find it.

thanks.
Ranzid
New member
 
Posts: 2
Joined: Thu Sep 27, 2012 5:04 pm
Top

Re: Large number of Site/SQL "hits"

Postby OldWolf » Fri Sep 28, 2012 6:12 pm

PFC is currently built to contact the server every few seconds and ask for any new updates. Each user's browser has to do this separately, meaning the more users = more connections.

By default PFC uses a 2 second delay. That's 30 checks a minute, which works out to be 1800 an hour. Running 15 users should only be around 24,000 "hits" to your website.

However, each connection can have multiple SQL queries. I can't give exact numbers, because I've never looked at the code for it, but it would not be surprising if there were 2-5 queries per hit. But that doesn't include your forum... depending on how you have all that set up, it could be making your forum run it's own set of queries every time as well. You can see how this would start to add up.

What you can do:
1. Stop using mysql for pfc if you are. It looks like that's just not practical for your host, and honestly I don't see any advantage to it.
2. Move PFC off of your forum. Unless you really need it, I would suggest it's a better idea to just use PFC separately on your particular host.
3. Increase the refresh delay parameter (http://www.phpfreechat.net/parameters#refresh_delay)... that'll slow the number of queries down (at the cost of a slower refreshing chat).
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Re: Large number of Site/SQL "hits"

Postby roman » Sat Sep 29, 2012 1:18 am

Go to src/pfcglobalconfig.class.php and change
var $container_type = 'Mysql';
to
var $container_type = 'File';
roman
New member
 
Posts: 3
Joined: Sat Sep 29, 2012 1:12 am
Top

Re: Large number of Site/SQL "hits"

Postby Ranzid » Sat Sep 29, 2012 2:56 am

thanks oldwolf thats helped alot , just knowing where I am in all this helps.
Roman , I presume that would make the usernames and logins a file instead of the SQL ..?
so then how would it get the information from the sql?

also i think ill be moving hosts no matter what , Fatcow and 1&1 look good any ideas?
Ranzid
New member
 
Posts: 2
Joined: Thu Sep 27, 2012 5:04 pm
Top

Re: Large number of Site/SQL "hits"

Postby roman » Mon Oct 01, 2012 12:57 am

Not, this is only about storage of chat data - container data.
roman
New member
 
Posts: 3
Joined: Sat Sep 29, 2012 1:12 am
Top


Post a reply
5 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 22 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub