1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Sending requests via proxy is too slow

Discussion in 'PHP' started by Kuna, Jun 8, 2020.

  1. #1
    I bought proxies and I’m making Guzzle requests to the API via proxies. Some requests are fast, 1-3 seconds, some last 30 seconds, a minute or more.

    I can't figure out why is that? Why are API requests taking so long via proxies? They are not free proxies. I tried to test by sending the same requests directly from my own server and it takes 1-2 seconds each request, every time.

    Those proxies are located near my country, they are located in neighboring countries.
     
    Kuna, Jun 8, 2020 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #2
    1) If you care about speed, what are you using proxies for?

    2) If you care about speed, what are you using proxies for?

    Now I realize that these are in fact only one point, but it's such a colossal sticking point I felt it being worthy of mention twice.

    Proxy times can be all over the place, as you've basically doubled the distance communication needs to occur in. You've added more and more variables into what can slow things down, including the use of different routing of packets, higher traffic, what the load is on said proxies... unless you're able to set up your own on your own dedicated servers, proxying for API calls is guaranteed to drag your performance down to utter shite.

    You're LUCKY the high end is only 30 seconds.

    My question is, what do you even think you NEED proxies for? Is this some sort of scammy "let's request from a bunch of different locations" spamming rubbish, or is there a legit above-board reason you're pulling this stunt?
     
    deathshadow, Jun 9, 2020 IP
    JEET likes this.
  3. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #3
    @Kuna
    Sending request via proxy will obviously increase time. You are making 2 http requests now, instead of one.
    If proxy is already processing something, your current call will have to wait till that process ends. Then apache will take next request.
     
    JEET, Jun 9, 2020 IP
    mmerlinn likes this.
  4. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    818
    Best Answers:
    7
    Trophy Points:
    320
    #4
    Since you are obviously for some reason, either good or bad, hiding something HOW do you know that your proxies are also not hiding something? Could be one or more of your proxies are calling ANOTHER proxy which in turn calls ANOTHER proxy. EVERY proxy call takes time and if one of your proxies calls ANOTHER proxy the time could go EXPONENTIAL.

    Set up your own proxies on your equipment where YOU can control them.
     
    mmerlinn, Jun 12, 2020 IP
    deathshadow and JEET like this.
  5. wmtips

    wmtips Well-Known Member

    Messages:
    598
    Likes Received:
    70
    Best Answers:
    1
    Trophy Points:
    150
    #5
    Moreover, the owners of these servers may not even know that they are being used as proxies.
     
    wmtips, Jun 17, 2020 IP
    deathshadow likes this.
  6. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #6
    ... and that's just part of why when people talk about using proxies in this sense, I automatically assume something skeezy is going on.
     
    deathshadow, Jun 17, 2020 IP
    mmerlinn likes this.
  7. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #7
    @wmtips

    How does that work? Owner not knowing at all?
    Won't someone need a proxy script of some sort on the server first, before they can use it as proxy?
     
    JEET, Jun 17, 2020 IP
  8. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #8
    Most "quality" malware tries not to reveal itself, so malware that acts as a proxy / bot is not uncommon at all. Much like injecting client-side mining scripts, setting up server side listeners to behave as a proxy is quite commonplace... probably more so.

    Especially when it comes to ultra-vulnerable "security, what's that then?!?" systems like Turdpress.

    It's probably one of the more insidious approaches to cracking into websites, doing so in a manner that sits there sucking on resources... it's not always about stealing information or defacing a site. More often it's about sitting there listening to data and exploiting any resource you can gain access to. Injected proxy scripts are just one of the many evils out there.

    There are also... disreputable hosts that piggy-back on the IP addresses they assign you. See pretty much all of the dirtbags that resell through colocrossing.

    Hence why when you start a new forum you often have to spend the first few months doing whois on IP's and looking for data center IP address ranges to drop at the firewall level. It's not just people who buy up large numbers of cheap VPS for spamming, but also the vulnerable hacked software people run that can be exploited by the scumbuckets in these data centers.
     
    deathshadow, Jun 18, 2020 IP
    JEET likes this.
  9. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #9
    @deathshadow
    Thanks for explaining this.
    How can I check if my server/vps is being used in this way without me knowing it?
     
    JEET, Jun 18, 2020 IP