开发者

Site slows for individual users, but they can switch browsers?

开发者 https://www.devze.com 2022-12-10 18:49 出处:网络
I\'ve tried searching for this but it\'s pretty difficult to put into words. Basically, our site will run fine for most users without any issues.Sometimes though, those of us who use the site pretty

I've tried searching for this but it's pretty difficult to put into words.

Basically, our site will run fine for most users without any issues. Sometimes though, those of us who use the site pretty heavily all day will suddenly get completely bogged down. Everything just spins in place. The site itself is still fine - everyone else can still get to it, but the individual user is stuck. In fact, restarting the browser entirely doesn't generally fix the issue, even if you explicitly clear your cookies.

You can, however, generally open the site just fine by switching to a different browser. If you're bogged down in Firefox, you can usually open it up and continue working just fine in IE. This can happen both ways (you can bog down IE, and switching to firefox works).

Does this make any sense at all? It's like there's something breaking with the session, but I don't know what would cause this and the session should reset by restarting the browser and clearing cookies and whatnot.

Any ideas?

[Editing to clarify, sorry, should have included this to begi开发者_StackOverflow中文版n with] Server is a very basic LAMP stack on RedHat with Apache 2.2.3, PHP 5.2.11, MySQL 5.0.45 (we've considered upgrading MySQL but I don't think this is the issue here). It's a standard configuration for Rackspace, so I don't think we're doing anything exotic besides maybe the Zend Optimizer.

We're using a lot of javascript/jquery but it's all pretty standard stuff and I wouldn't expect a memory leak to not affect the other browser, though I may be wrong.

Also, our server's CPU and memory usage have never broken the 25% margin, even in spikes, and the spikes don't seem to correlate with this phenomenon.


Sounds pretty much like you have some sort of session locking issue. You state that even removing cookies doesn't help, which makes session locks seem less plausible, but I don't have any details on your implementation so it's still possible.

I have two questions i'd need answered to gain some insight into the problem.

  1. Do you have a session open while streaming content and attempting to read from or write to the session on a different request?

  2. Have you've implemented your own sessions?

If you're answering yes or maybe to question 1, that's probably the root of your problem then.

If you're answering yes to question two, does the problem persist if you switch session management to standard php? You could have a bug in your session handling.


G'day,

It sounds like you're persisting some sort of info on the server side on a per-session basis.

Are you persisting session id's or user id's on the server? Maybe adding more and more information to some persisted data with each subsequent incoming request?

Maybe the incoming User Agent string is also involved which is why changing browser types works, where simply restarting a session in the same type of browser doesn't work?

Have you seen if stopping and restarting a session across a time boundary, e.g. the hour, or midnight, when using the same browser also resets the problem? Maybe try spoofing the UA string to see if that also resets the problem.

BTW What Apache modules are you running in your server? Also 2.2.3 is quite an old version have you considered upgrading?


It's look like to me that it is a Memory Leaks that your javascript creates. Check your process list and see how much memory browser consume in begining and after half an hour of browsing and reloading your website. If if memory consumption is significantly more than it suppose to be thats meen that you have to review your javascript code for any unreturned methods, unbreaked loops and so on. Usualy it helps.


Interestingly no one has suggested advertisements as the cause (Nazariy's answer could be adopted to those though).

Basically check the advertisements shown on your site, there's a ton of crap in those things and they're always based on user recognition which would explain why restarting the browser doesn't help.


This has happened to me too, frequently, in fact. Completely stateless site, lot's of AJAX requests, after a while the site just becomes unresponsive. It's especially annoying during debugging. Here are some things you have to be aware:

  • Number of JS files loaded (it includes the ones you get using script requests) (You should probably delete the script tags created if you use that method)
  • Number of CSS files (for example, on IE, there is a hard limit of 31, I think)
  • Sometimes the browser can lock into a DNS resolution request
  • Some browsers have limits on the number of requests to domains (IE has 2) so if there is a request not fulfilled, all the others to that domain will have to wait

All this of course doesn't explain why it keeps hanging after you restart the same browser - though you haven't mentioned clearing your cache, so maybe there is a failed request that is sitting in your browser cache or some intermediate cache or proxy, so you can try to see if this happens if you completely turn caching off in your browser. (On Firefox this can be easily done using the Web Developer toolbar, for example.)

You should also see what requests hang, use Fiddler and Firebug to see that.


Memory leaks caused by javascript affect the browser, because it's all client side. Jquery compress or min you can't be sure where the problem is, and it is likely to be the cause problems, or the script using it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号