{"action":"created","issue":{"url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/188","repository_url":"https://api.github.com/repos/web-push-libs/web-push-php","labels_url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/188/comments","events_url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/188/events","html_url":"https://github.com/web-push-libs/web-push-php/issues/188","id":373220433,"node_id":"MDU6SXNzdWUzNzMyMjA0MzM=","number":188,"title":"Offtopic: How much memory do I need for lets say 150K push messages?","user":{"login":"fpilee","id":1960075,"node_id":"MDQ6VXNlcjE5NjAwNzU=","avatar_url":"https://avatars3.githubusercontent.com/u/1960075?v=4","gravatar_id":"","url":"https://api.github.com/users/fpilee","html_url":"https://github.com/fpilee","followers_url":"https://api.github.com/users/fpilee/followers","following_url":"https://api.github.com/users/fpilee/following{/other_user}","gists_url":"https://api.github.com/users/fpilee/gists{/gist_id}","starred_url":"https://api.github.com/users/fpilee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpilee/subscriptions","organizations_url":"https://api.github.com/users/fpilee/orgs","repos_url":"https://api.github.com/users/fpilee/repos","events_url":"https://api.github.com/users/fpilee/events{/privacy}","received_events_url":"https://api.github.com/users/fpilee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-23T21:57:41Z","updated_at":"2018-11-02T07:00:23Z","closed_at":"2018-10-25T20:25:44Z","author_association":"NONE","body":"Hello\r\n\r\nI was wondering if I will need more than a 1gb of ram in my server to send messages to 150K users. \r\n\r\nI'm using this code and i guess somewhere there is a big php array ?\r\n```\r\n            foreach ($users as $user){\r\n\r\n                $msg = $data;\r\n                $msg['body'] = $data[\"body\"][$user['language']];\r\n                $msg['title'] = $data[\"title\"][$user['language']];\r\n                $webPush->sendNotification(\r\n                    Subscription::create([\r\n                        \"authToken\" => $user['auth_token'],\r\n                        \"publicKey\" => $user['public_key'],\r\n                        \"endpoint\" => $user['endpoint'],\r\n                    ]),\r\n                    json_encode($msg)\r\n                );\r\n            }\r\n            $webPush->flush();\r\n```"},"comment":{"url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/comments/435289236","html_url":"https://github.com/web-push-libs/web-push-php/issues/188#issuecomment-435289236","issue_url":"https://api.github.com/repos/web-push-libs/web-push-php/issues/188","id":435289236,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTI4OTIzNg==","user":{"login":"t1gor","id":1280013,"node_id":"MDQ6VXNlcjEyODAwMTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1280013?v=4","gravatar_id":"","url":"https://api.github.com/users/t1gor","html_url":"https://github.com/t1gor","followers_url":"https://api.github.com/users/t1gor/followers","following_url":"https://api.github.com/users/t1gor/following{/other_user}","gists_url":"https://api.github.com/users/t1gor/gists{/gist_id}","starred_url":"https://api.github.com/users/t1gor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t1gor/subscriptions","organizations_url":"https://api.github.com/users/t1gor/orgs","repos_url":"https://api.github.com/users/t1gor/repos","events_url":"https://api.github.com/users/t1gor/events{/privacy}","received_events_url":"https://api.github.com/users/t1gor/received_events","type":"User","site_admin":false},"created_at":"2018-11-02T07:00:23Z","updated_at":"2018-11-02T07:00:23Z","author_association":"NONE","body":"Looks like you're right: [`$this->notifications[] = new Notification($subscription, $payload, $options, $auth);`](https://github.com/web-push-libs/web-push-php/blob/master/src/WebPush.php#L122)\r\n\r\nTo save some, you can send your notifications in batches: just chunk your `$users` array or paginate the query."}}
{"actor":{"display_login":"t1gor"}}