Nirjonadda
Well-known member
Can not View own IP. Clicking the IP button but still are not open the popup. Viewing other user IP are working.
Works ok here for my IP addresses.
SELECT COUNT(*)
FROM xf_ip WHERE user_id = 12345
Is there a difference in the number of IP addresses logged for each user? You'd need to run this on the database for each user (you'll need their user IDs) to see if there is a big difference in the number of records. That's the only reason I'd think it could be slow. We have made a change recently which should reduce the number of IP logs that can be generated:
(Replace 12345 with the user's user ID, repeat for each user to compare).SQL:SELECT COUNT(*) FROM xf_ip WHERE user_id = 12345
That's a fairly astonishing number. How many records does your xf_ip table have in total?
As most people know, I'm here all of the time, and I only have 8414 IP logs.
If your users have consistently over several hundred thousand IPs logged then that could certainly cause some performance issues when searching for specific IPs.
What value do you have if you search for the "ipLogCleanUp" option? (You can use Admin search to find it).
EXPLAIN SELECT ip
FROM xf_ip
WHERE content_type = 'user'
AND content_id = 19
AND action = 'register'
ORDER BY log_date DESC
LIMIT 1
That doesn't really answer the question as to why you actually need all of that IP address history. We log IP addresses all of the time. The delete option will only delete logs which are older than 365 days (or whatever you specify). For example, the last one year's worth of posts will have IP history. The last one year's worth of logins will have IP history. Using the Shared IPs feature will still work, the list of IP addresses in the Admin CP will show a year's worth of history.
That query was merely to see if there was anything unusual in how MySQL was processing it. Did it seem to take a while to run, or was it quick?
The only other aspect could be the host lookup, but that code is actually the same as XF1 (as is pretty much everything else, in fact). So it really just seems to be a MySQL tuning issue at this point where it isn't coping too well looking up so many records.
Upload this to your XF root and edit the file and change the IP_1 and IP_2 values to, ideally, a couple of the IP addresses from the affected user.
It does 2 host look ups because essentially that's what happens on the post ID form (it looks up a post IP address and a registration IP address).
Each host name look up should report back how long it took.
Parse error: syntax error, unexpected '117.194' (T_DNUMBER), expecting identifier (T_STRING) in /home/user/public_html/test.php on line 3
You need to make sure the IP addresses have single quotes around them, like the original example in the script has:
PHP:const IP_1 = '8.8.8.8'; const IP_2 = '4.4.4.4';
Performing host look up of IP 11x.194.204.17x
Hostname 11x.194.204.17x found. Time taken (0.12s)
Hostname 11x.194.197.20x found. Time taken (0.35s)
Somewhat unexpected as now I have no idea what’s causing it to be slow.
We use essential cookies to make this site work, and optional cookies to enhance your experience.