Jump to content

Do .js files query the database?


Guest fishfood

Recommended Posts

Posted

Hi there,

I've got major issues with my hosting provider. I run a moderately popular website with several thousand registered members, but only ever about 10-20 users online at a time (although there are normally a similar number of guests too).

They say that the site has outgrown the resellers account I currently use and I need to move up to a dedicated server. I disagree with them and think they're just trying to get more money off me.

Anyway - after lengthy discussion they reckon that this is the list of files which are being most problematic in terms of causing CPU overload:

[*@web247 logs]# cat *************.com-access_log | fgrep "20/Jan/2009" | awk '{print $8}' | sort | uniq -c | sort -n | tail


620 /forum/jscripts/dom-drag.js


623 /forum/jscripts/ips_menu.js


626 /forum/jscripts/ips_ipsclass.js


630 /forum/jscripts/ipb_global.js


637 /forum/style_images/ip.boardpr/menu_action_down.gif


641 /forum/style_images/ip.boardpr/css_colors.css


656 /forum/style_images/ip.boardpr/iframe.html


667 /forum/jscripts/ips_xmlhttprequest.js


771 /forum/index.php?act=idx




Looking at the files I see a lot of javascipt files, a gif, a css and not a a couple of index.php's!

Can someone tell me please if those js files could be querying the database? I didn't think they did but I could be wrong.

Thanks!
Posted

JS file themselves cannot query a server database as they run on the client.

However they can send httprequests to a script on the server and that script can read the database and send the response back to the JS script for processing. Some of the IPS JS file do these such calls for returning data for processing without the need to refresh the page (Ajax).

So yes in theory some of those JS files are sending requests to a server script that will read the database. Having said that, I do not think this is overly used.

  • 1 month later...
Posted

The thing from the list that I think would cause the most use of server resources is the /forum/index.php?act=Search&CODE=getnew
It's a search on the forums for every new post since the previous visit.

If your database isn't optimised or MySQL is not optimally configured, that could be the cause of the problems.

What have you 'outgrown'? IS it CPU or disk I/O? Have they explained that to you?

They are the hosts, you are the customer. What have THEY tried to improve things?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...