Coder Social home page Coder Social logo

Comments (8)

zimbatm avatar zimbatm commented on September 4, 2024 2

Hi,

sorry it took me a bit of time to get back to you.

I just ran the same benchmark from the UK and it's taking 9.9 seconds to send 100 requests. So ~10 requests per second or 100ms per request.

One reason I can think of why you are getting higher latencies would be if HTTP Keep-Alive is not used, most likely if an old version of PHP or curl is being used. In that case the TCP and SSL negotiation would have to be re-done on each request which would prove expensive (4 round trips at 60ms = 240ms).

Another reason would be the latency between hostgator and the Amazon us-east-1 datacenter. I don't know anything about hostgator's network quality and peering agreement so do let me know if you find out more about it. All I know is that traffic between the west and east of US generally adds 60ms of latency. You can find more about it over here: http://console.datapath.io/map for global latencies map. So if latency is important to you I would recommend to find a host that is closer to where pusher is being deployed. One good way to find out about latency would be to run ping api.pusherapp.com from your hosting provider.

If you need even more throughput we also have a batching end-point that can send multiple events in one HTTP call. This removes some of the header overhead from HTTP requests. We haven't documented this yet but if you're interested do let me know.

Hope that helps. Please get back to me if you have further questions.

from pusher-http-php.

zimbatm avatar zimbatm commented on September 4, 2024

I agree, 500ms is bad but our API internal latency is around 30ms. How do you measure the latency and where are your servers located ?

from pusher-http-php.

nzhome avatar nzhome commented on September 4, 2024

php server is located us west at hostgator.com

this clearly takes 60 seconds to complete on the Pusher side. not sure why when the trigger was pushed as fast as it could handle

php code :

for ($x = 0; $x <= 120; $x++) {
$data['message'] = '00:00:00.' . str_pad($x , 4, "0", STR_PAD_LEFT);
$pusher->trigger('test_channel', 'my_event', $data);
}

from pusher-http-php.

nzhome avatar nzhome commented on September 4, 2024

I was actually using AP1 Asia Pacific 1. which is closer to where I am in New Zealand. because I thought it would mean the browser talks directly to the AP1 server. Its using the latest hostgator server, less than a month old, so I am sure the http keep alive is active?

from pusher-http-php.

zimbatm avatar zimbatm commented on September 4, 2024

Alright. If you use the same map (http://console.datapath.io/map and select AWS and Singaport (ap-southeast-1) you'll see that the latency is ~200ms to us west. Feel free to contact us on [email protected] if you want to share more private information. You can find your own latency by running ping api-ap1.pusher.com and mtr --report api-ap1.pusher.com

from pusher-http-php.

kn100 avatar kn100 commented on September 4, 2024

Closed as not our latency that is at issue.

from pusher-http-php.

sathninduk avatar sathninduk commented on September 4, 2024

Same issue. But I think the real issue is SharedArrayBuffers (SABs) can be used to construct high-resolution timers. High-resolution timers simplify Spectre attacks on cross-origin resources. That's why browsers are slowing down pusher

from pusher-http-php.

Alireza17224 avatar Alireza17224 commented on September 4, 2024

Pusher speed is super slow! How can i fix it ?!

from pusher-http-php.

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.