lundi 12 octobre 2020

is it good practice to use php artisan queue:listen on liver server with supervisor?

We are using laravel jobs. And our memory size is 1 GB RAM . I have observed that queue:work uses 102 MB of RAM on the other hand queue:listen uses only 30 MB RAM I know queue:listen fire up framework with every process. But question i want to ask is can I use queue:listen on live server because we have memory issue and there are multiple jobs it might slow down the process but server will not got hanged.

You can observed log when i was running queue:work

New File Size: 41.75

memory usage: 84 MiB

After Merging File size: 52.80

[2020-10-12 21:08:20][208] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:20][209] Processing: App\Jobs\Consignment\MergeLabel
count: 20

Existing File Size: 52.80

New File Size: 41.82

memory usage: 84 MiB

After Merging File size: 118.39

[2020-10-12 21:08:20][209] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:21][210] Processing: App\Jobs\Consignment\MergeLabel
count: 40

Existing File Size: 118.39

New File Size: 41.96

memory usage: 84 MiB

After Merging File size: 208.51

[2020-10-12 21:08:21][210] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:21][211] Processing: App\Jobs\Consignment\MergeLabel
count: 60

Existing File Size: 208.51

New File Size: 42.54

memory usage: 84 MiB

After Merging File size: 334.83

[2020-10-12 21:08:22][211] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:22][212] Processing: App\Jobs\Consignment\MergeLabel
count: 80

Existing File Size: 334.83

New File Size: 41.70

memory usage: 84 MiB

After Merging File size: 507.95

[2020-10-12 21:08:23][212] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:23][213] Processing: App\Jobs\Consignment\MergeLabel
count: 100

Existing File Size: 507.95

New File Size: 42.38

memory usage: 84 MiB

After Merging File size: 741.24

[2020-10-12 21:08:24][213] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:24][214] Processing: App\Jobs\Consignment\MergeLabel
count: 120

Existing File Size: 741.24

New File Size: 42.18

memory usage: 84 MiB

After Merging File size: 1,047.87

[2020-10-12 21:08:26][214] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:26][215] Processing: App\Jobs\Consignment\MergeLabel
count: 140

Existing File Size: 1,047.87

New File Size: 41.45

memory usage: 86 MiB

After Merging File size: 1,447.33

[2020-10-12 21:08:28][215] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:28][216] Processing: App\Jobs\Consignment\MergeLabel
count: 160

Existing File Size: 1,447.33

New File Size: 41.52

memory usage: 86 MiB

After Merging File size: 1,956.00

[2020-10-12 21:08:32][216] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:32][217] Processing: App\Jobs\Consignment\MergeLabel
count: 180

Existing File Size: 1,956.00

New File Size: 41.40

memory usage: 88 MiB

After Merging File size: 2,588.48

[2020-10-12 21:08:35][217] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:35][218] Processing: App\Jobs\Consignment\MergeLabel
count: 200

Existing File Size: 2,588.48

New File Size: 42.04

memory usage: 92 MiB

After Merging File size: 3,352.99

[2020-10-12 21:08:39][218] Processed:  App\Jobs\Consignment\MergeLabel
count: 220

Existing File Size: 3,352.99

New File Size: 42.51

memory usage: 96 MiB

After Merging File size: 4,267.85

[2020-10-12 21:08:42][219] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:42][220] Processing: App\Jobs\Consignment\MergeLabel
count: 240

Existing File Size: 4,267.85

New File Size: 38.11

memory usage: 102 MiB

After Merging File size: 5,326.96

[2020-10-12 21:08:50][220] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:08:50][221] Processing: Illuminate\Notifications\Events\BroadcastNotificationCreated
[2020-10-12 21:08:51][221] Processed:  Illuminate\Notifications\Events\BroadcastNotificationCreated

When I use queue:listen

[2020-10-12 21:21:55][14] Processing: App\Jobs\Consignment\MergeLabel
New File Size: 41.75

memory usage: 24 MiB

After Merging File size: 52.80

[2020-10-12 21:21:55][14] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:21:56][15] Processing: App\Jobs\Consignment\MergeLabel
count: 20

Existing File Size: 52.80

New File Size: 41.82

memory usage: 24 MiB

After Merging File size: 118.39

[2020-10-12 21:21:56][15] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:21:57][16] Processing: App\Jobs\Consignment\MergeLabel
count: 40

Existing File Size: 118.39

New File Size: 41.96

memory usage: 24 MiB

After Merging File size: 208.51

[2020-10-12 21:21:57][16] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:21:57][17] Processing: App\Jobs\Consignment\MergeLabel
count: 60

Existing File Size: 208.51

New File Size: 42.54

memory usage: 24 MiB

After Merging File size: 334.83

[2020-10-12 21:21:58][17] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:21:58][18] Processing: App\Jobs\Consignment\MergeLabel
count: 80

Existing File Size: 334.83

New File Size: 41.70

memory usage: 26 MiB

After Merging File size: 507.95

[2020-10-12 21:21:59][18] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:00][19] Processing: App\Jobs\Consignment\MergeLabel
count: 100

Existing File Size: 507.95

New File Size: 42.38

memory usage: 26 MiB

After Merging File size: 741.24

[2020-10-12 21:22:00][19] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:01][20] Processing: App\Jobs\Consignment\MergeLabel
count: 120

Existing File Size: 741.24

New File Size: 42.18

memory usage: 26 MiB

After Merging File size: 1,047.87

[2020-10-12 21:22:02][20] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:02][21] Processing: App\Jobs\Consignment\MergeLabel
count: 140

Existing File Size: 1,047.87

New File Size: 41.45

memory usage: 26 MiB

After Merging File size: 1,447.33

[2020-10-12 21:22:04][21] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:04][22] Processing: App\Jobs\Consignment\MergeLabel
count: 160

Existing File Size: 1,447.33

New File Size: 41.52

memory usage: 26 MiB

After Merging File size: 1,956.00

[2020-10-12 21:22:06][22] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:07][23] Processing: App\Jobs\Consignment\MergeLabel
count: 180

Existing File Size: 1,956.00

New File Size: 41.40

memory usage: 26 MiB

After Merging File size: 2,588.48

[2020-10-12 21:22:09][23] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:10][24] Processing: App\Jobs\Consignment\MergeLabel
count: 200

Existing File Size: 2,588.48

New File Size: 42.04

memory usage: 28 MiB

After Merging File size: 3,352.99

[2020-10-12 21:22:12][24] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:13][25] Processing: App\Jobs\Consignment\MergeLabel
count: 220

Existing File Size: 3,352.99

New File Size: 42.51

memory usage: 28 MiB

After Merging File size: 4,267.85

[2020-10-12 21:22:16][25] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:17][26] Processing: App\Jobs\Consignment\MergeLabel
count: 240

Existing File Size: 4,267.85

New File Size: 38.11

memory usage: 30 MiB

After Merging File size: 5,326.96

[2020-10-12 21:22:24][26] Processed:  App\Jobs\Consignment\MergeLabel
[2020-10-12 21:22:25][27] Processing: Illuminate\Notifications\Events\BroadcastNotificationCreated
[2020-10-12 21:22:25][27] Processed:  Illuminate\Notifications\Events\BroadcastNotificationCreated


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire