web-push-php icon indicating copy to clipboard operation
web-push-php copied to clipboard

Using Vapid Sending speed Slow Notification (Max 180/ Minute)

Open dhirenr opened this issue 4 years ago • 10 comments

Can anyone help me to find out slow notification sending speed?

I have used many servers like VPS, Dedicated, Shared sever. I got 16 GB Ram & 4 CPU. But still, this application sending notification to subscriber 180/Minute highest.

dhirenr avatar Mar 25 '20 16:03 dhirenr

This should change when #228 is merged (~80x~ ~50x faster)

Spomky avatar Mar 25 '20 16:03 Spomky

Still it slow. @Spomky Is there any other suggestions.

dhirenr avatar Apr 12 '20 05:04 dhirenr

Do you send notifications one by one or do you use flush method ?

ozgurhangisi avatar Aug 30 '20 18:08 ozgurhangisi

I used flush. I have updated with latest. Whether I increased RAM or CPU, its not sending faster.

On Sun, Aug 30, 2020 at 11:58 PM wisozg [email protected] wrote:

Do you send notifications one by one or do you use flush method ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/web-push-libs/web-push-php/issues/277#issuecomment-683453889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6CIPEJO75ORQZUTPSJVL3SDKK5RANCNFSM4LTSLH7A .

dhirenr avatar Aug 31 '20 16:08 dhirenr

Are you sure that it's related with this library. Because normally you should have sent at least 100 notification / second. Can you isolate db operations and push sending operations. Sometimes db operations (getting endpoints, deleting expire tokens etc..) can affect sending speed.

ozgurhangisi avatar Aug 31 '20 16:08 ozgurhangisi

With the native scalar multiplication function, there is no reason for this lib to be slow. I closed the PR and re-introduced it in #289. If it doesn’t speed it up, there is another problem I don’t understand at the moment…

Spomky avatar Aug 31 '20 17:08 Spomky

Yes, I have used this library. But I got your point. Its related to db operation & push sending operation. I have used both getting endpoints, deleting expire tokens. How can I connect you?

On Mon, Aug 31, 2020 at 9:53 PM wisozg [email protected] wrote:

Are you sure that it's related with this library. Because normally you should have sent at least 100 notification / second. Can you isolate db operations and push sending operations. Sometimes db operations (getting endpoints, deleting expire tokens etc..) can affect sending speed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/web-push-libs/web-push-php/issues/277#issuecomment-683883645, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6CIPBR7SMFAFT62IXRBDDSDPE63ANCNFSM4LTSLH7A .

dhirenr avatar Aug 31 '20 17:08 dhirenr

You can connect me using this ticket.

You should measure how long it takes to finish each operations (Getting endpoints from DB, sending pushes, cleaning expired tokens etc..). If you measure each operations, we can help you better.

ozgurhangisi avatar Aug 31 '20 17:08 ozgurhangisi

Ok will send soon.

dhirenr avatar Aug 31 '20 17:08 dhirenr

I have tried with a list of 200 endpoints Time Get 200 endpoints: 0.065155s Time to send ($webPush->flush()): 4.419076s Log update time: 0.187559s Total time: 4.885548s

Upto: Time send: 14.921125 (when send more 2K )

It is too slow, I submitted the 94K endpoint list in 45 minutes.

bcat95 avatar Dec 14 '20 13:12 bcat95