You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because there are so many nodes and API requests are charged by credits, constantly checking some 12,000+ nodes runs the credits thin each month. I'd like to reduce the number of API requests made to our IP intelligence service by doing the following:
Check node_score table for null asn value for current node in request
If asn == NULL then go ahead with the query else return
This will create queries only when we do not have current ASN data for the node and greatly reduce the amount of credits used.
mysql> show fields from node_score
-> ;
+--------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| node_address | varchar(100) | NO | PRI | NULL | |
| asn | varchar(15) | YES | | NULL | |
| isp | varchar(200) | YES | | NULL | |
| isp_type | varchar(50) | YES | | NULL | |
| datacenter | tinyint(1) | YES | | NULL | |
+--------------+--------------+------+-----+---------+-------+
5 rows in set (0.00 sec)
You should create a function in the class to query the table for the asn value WHERE node_address = node
The call to this function should take place before this line:
Because there are so many nodes and API requests are charged by credits, constantly checking some 12,000+ nodes runs the credits thin each month. I'd like to reduce the number of API requests made to our IP intelligence service by doing the following:
asn
value for current node in requestasn
== NULL then go ahead with the query else returnThis will create queries only when we do not have current ASN data for the node and greatly reduce the amount of credits used.
You should create a function in the class to query the table for the
asn
value WHERE node_address =node
The call to this function should take place before this line:
meile-cache-server/meile_intelligence.py
Line 100 in 15f14c6
and should handle the results appropriately.
This will save me a little bit of time to work on other stuff. Hence the bounty.
The text was updated successfully, but these errors were encountered: