View own IP

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.
 
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:
SQL:
SELECT COUNT(*)
FROM xf_ip WHERE user_id = 12345
(Replace 12345 with the user's user ID, repeat for each user to compare).
 
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:
SQL:
SELECT COUNT(*)
FROM xf_ip WHERE user_id = 12345
(Replace 12345 with the user's user ID, repeat for each user to compare).

One admin user count 254668 and My user ID count 193185. What the fix for this issue?

-eyMSet2S5ueCmAf3PfFYw.png
 
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).
 
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).

Because this user post count 236,872 and post IP log also be logged. Please note, XF1 worked to view this user IP and me too. Do you asking option for "Delete IP usage data after" ?

aenKDuPJTyee6JFubeEBrQ.png


UzvxwkYUSD_0EMvoSChuoQ.png
 
Well, it's not really surprising it previously worked. At some point the same queries will get slower and slower when faced with a growing set of data. I'm not necessarily saying it shouldn't be able to cope with that many records, but as it happens, the reason you have so many records for each user is it appears as though you have switched off the option to prune IP logs.

Do you have a legal requirement to permanently keep old IP logs? Or some other reason for doing it?

As noted in the option text there, old IP logs are rarely useful and they're taking up over 1GB of disk space. They become less useful considering that the majority of users most likely have dynamic IP addresses, and a growing number of users are using proxies and VPNs which will also have a dynamic address, and often a fairly small address pool that is reused over and over.

It's potentially not worth re-enabling the delete IP usage data option just yet, as it could be interesting to find out what is causing it. My hunch that it's not actually the content IP address look up that's causing it (because that's generally just a primary key lookup) but instead it could be the fact that we try to do a look up of the user registration IP too, which may be a less performant query.

Can you run this query against the user who has the higher number of IP logs and let us know the result:
SQL:
EXPLAIN SELECT ip
FROM xf_ip
WHERE content_type = 'user'
   AND content_id = 19
   AND action = 'register'
ORDER BY log_date DESC
LIMIT 1
Also if you can note how long the query takes to execute that would be useful.

If it's not that, then it could be the host name lookup.
 
I can not enable option "Delete IP usage data after" because some time ago we have issue from IP that 13,000 user No IP logs and this issue fixed by @Mike and @Jake Bunce from this post. Also Why prune option are not remain at least one IP address per user?

Still does not open IP log for this user.

vHKHtVdFQ9SpMnxies6QYg.png
 
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.
 
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.

Yes its delete the old all log. If user are not do login after the prune then this user No IP logs. Prune option must have a functionality remain at least one IP address per user.

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?

Its was quick run.

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.

This user IP lookup are working in Moderator tools but not working in post IP and who is online. So I did not think its issue from MySQL tuning issue. If so what you are recommended for MySQL tuning?

XLaWSY_aQMeczjGQhv1uUw.png
 
Last edited:
I already alluded to this, but the only difference between the post IP look up and the full IP addresses look up is the fact that the post IP look up does a hostname look up.

This might be where the latency is coming from, which would suggest issues with your server being able to resolve DNS lookups.

Bear with me, let me put a little test script together. That will potentially prove the problem and also give you something to show your host to prove the issue to them (it will likely be them that need to take action to resolve this).
 
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.
 

Attachments

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.

Getting this error from /test.php

Code:
 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';
 
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';

I think this is the result?

Code:
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)
 
Top Bottom