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

[ask] Send to multiple users at the same time

Open bcat95 opened this issue 5 years ago • 3 comments

Stable: When sending webpush to a specific endpoint of order notification, it takes 0.07s total time, query db, req to fcm.googleapis.com and log.

Slow: When sending 200 endpoints, I time out the segments as follows:

  • Time to get 200 endpoints put into the array: 0.065155s
  • Time req to fcm.googleapis.com: 4.419076s
  • Logging time: 0.187559s Total time: 4.885548s

Very slow: When sending continuously> 2000 endpoint, the time to req fcm.googleapis.com to 15-20s.

Currently web-push-php uses the GuzzleHttp \ Client library to request

CPU Usage: mariadbd: 36 to 80% CPU - 2 Intel core (R) Xeon (R) 2200.186 56320 KB RAM usage: mariadbd: 270 Mb total - 4Gb ram Ping fcm.googleapis.com: 1.45 ms PHP Tried 7.3 , 7.4, 8.0

The problem I realized the time req to fcm.googleapis.com is currently the cause of the slowdown. So how to optimize this time?

My List: >30K

bcat95 avatar Feb 11 '20 07:02 bcat95

I still continue to build a way to send large numbers of sub..

bcat95 avatar Mar 18 '20 01:03 bcat95

@bcat95 Hello, I've been trying to send notifications to several devices at the same time but no where as much as you're sending and or trying to send. It's just about 10 in total but I notice that it only send the notification for the very last row but not rows 1-9. Could you provide any assistance regarding this?

8Ozymandias avatar Jun 30 '20 23:06 8Ozymandias

@bcat95 Hello, I've been trying to send notifications to several devices at the same time but no where as much as you're sending and or trying to send. It's just about 10 in total but I notice that it only send the notification for the very last row but not rows 1-9. Could you provide any assistance regarding this?

Are you having a looping problem in php?

bcat95 avatar Jan 27 '21 07:01 bcat95