Code Monkey home page Code Monkey logo

Comments (4)

jjsendor avatar jjsendor commented on August 20, 2024

As per requests documentation in the module requests.packages.urllib3.connectionpool:

If the pool is already full, the connection is closed and discarded because we exceeded maxsize. If connections are discarded frequently, then maxsize should be increased.

I don't think this is a big problem, but we may need to increase the pool size, so that the connections are not discarded that often.

from threat_intel.

blischalk avatar blischalk commented on August 20, 2024

I am receiving the folowing error:

WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: www.virustotal.com

Many times when trying to get a report for ~2000 domains. Has this connection pool issue been resolved?

I get it if I send all 2000 at once or if I iterate over the domains making an API call per domain.

#!/usr/bin/python
import os
import time
from threat_intel.virustotal import VirusTotalApi


vt = VirusTotalApi(os.environ["VIRUS_TOTAL"], resources_per_req=1)
fo = open("questionable_domains.txt", "r")
domains = fo.readlines()

# print(vt.get_domain_reports(domains))

for domain in domains:
    print(vt.get_domain_reports(domain))

from threat_intel.

leeren avatar leeren commented on August 20, 2024

The reason for this issue was that the customized SSL Adapter mounted to each session was using a max HTTPConnectionPool size of 10. Specifically, this meant that each connection pool corresponding to a specific host could only issue 10 requests asynchronously per batch before filling up and discarding the connection. The fix was as simple as specifying for the adapter to take in a maximum pool size corresponding to the max of the grequest batch size and 10 (default max pool size used by the HTTP adapter).

from threat_intel.

leeren avatar leeren commented on August 20, 2024

Fixed with #74.

from threat_intel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.