Skip to main content
Topic: Intermittent Loading Slowdowns (Read 9194 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Intermittent Loading Slowdowns

Reply #30

Good to hears the source(s) of the slowdowns seem to have been found  :D One we can fix, one not sure we can do anything other than what we have now (checkbox to disable).  Anyone know why those hostname lookups are slow on some systems?  Is there an alternative other than disable?

Re: Intermittent Loading Slowdowns

Reply #31

If it helps, I narrowed the issue down to PHP's built-in gethostbyaddr() function here:

https://github.com/elkarte/Elkarte/blob/master/sources/Subs.php#L3191

The system calls above are instant. But using the PHP method seems to cause long delays.

Re: Intermittent Loading Slowdowns

Reply #32

Maybe this is a result that could be cached?
It seems after a little bit of reading that some people are saying it causes the script to slow when an IP isn't resolved.
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: Intermittent Loading Slowdowns

Reply #33

Reading around on the web it kind of confirms that gethostbyaddr is slow or can be slow and there isn't much to do about it.

@IchBin cache is already used, though is not really always useful in that case, because if the IP is not present (and the likelihood it is not is far greater than the contrary) in the cache we have to resolve it to get the hostname. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: Intermittent Loading Slowdowns

Reply #34

I understand that it might not be useful in the case where the IP is not present. But in the case when a lookup can take a significant amount of time to actually obtain the IP, this could save the time in that case for the next time it looks up that same IP that doesn't resolve quickly. But if cache is already used for this, and the issue really is not being to find the IP at all, there's not much that can be done about that. lol
Success is not the result of spontaneous combustion, you must set yourself on fire!