jaypipes / pcidb

Small golang library for querying PCI database (pciids) information
Apache License 2.0
32 stars 14 forks source link

Too many accesses to pci-ids.ucw.cz #28

Closed gollux closed 1 month ago

gollux commented 2 years ago

Hello!

This is the maintainer of the PCI ID database (pci-ids.ucw.cz) speaking.

I am currently getting more than 200000 requests per day from your module, but only from about 300 unique IP addresses per day. That translates to 60 GB of data daily! This looks like you have seriously broken (or non-existent) caching.

Could you please fix it quickly and notify your users? Otherwise I will have to implement bandwidth limits.

Even better, please consider sending individual queries to the PCI ID database using DNS. The protocol has no good documentation, but you can copy the implementations from pciutils/lib/names-net.c.

jaypipes commented 2 years ago

Hi @gollux! So sorry that my library has caused issues for you!

The way that the library works is actually to first look for the PCI database files in a set of known locations and only if no PCI database file can be found on the local filesystem and the network fetch feature has not been disabled, attempt to fetch the latest PCI database from pci-ids.ucw.cz.

The only time that the network fetch occurs is when the platform is Windows (which AFAIK does not have the PCI database files cached locally like Linux does...) or if the library is loaded from a filesystem (perhaps in a container?) that does not have any of the PCI IDS database files mounted into it from the local Linux host.

If you would please email me jaypipes at gmail dot com any informaiton you have about those 300 unique IP addresses I can do some investigation and see what might be causing those calls to your pci-ids.ucw.cz site from the library. I suspect that may be some testing or CI platform (Kubernetes or one of the Kubernetes networking drivers) that includes this library in the container image used for testing and that container image's filesystem does not have a bind mount to pass the Linux host's pci-ids files into the container.

taigrr commented 2 years ago

I've created PRs on the following repos to help satisfy @gollux 's request that we notify users. I'm sure the majority of the traffic is from the kubernetes repos, but I don't think it will hurt to proliferate this change more widely.

https://github.com/yunionio/cloudpods/pull/13788 https://github.com/livepeer/go-livepeer/pull/2340 https://github.com/jm33-m0/emp3r0r/pull/103 https://github.com/portainer/agent/pull/280 https://github.com/ericmaustin/unixtools/pull/1