Mysql memory calculator, check my math Plz
Posted: Mon Jan 25, 2021 4:14 pm
I've been getting oom-killer messages since I added a new camera. Rather than use a calculator to try to add up the total memory required, I figured I'd let MySQL do the work.
Somebody please check my math. Maybe others will benefit from the mysql script.
Somebody please check my math. Maybe others will benefit from the mysql script.
Code: Select all
mysql> select x.Id, x.Width, x.Height, x.ImageBufferCount, x.Colours, x.BufferSpace as BufferMB, 1.2*sum(x.BufferSpace) over (Order by Id) as RunningTotalMB_w_OH from (select Id, Width,Height,ImageBufferCount,Colours,(W
idth*Height*ImageBufferCount*Colours/1024/1024) as BufferSpace from Monitors order by Id) x;
+----+-------+--------+------------------+---------+---------------+---------------------+
| Id | Width | Height | ImageBufferCount | Colours | BufferMB | RunningTotalMB_w_OH |
+----+-------+--------+------------------+---------+---------------+---------------------+
| 1 | 1920 | 1080 | 100 | 3 | 593.26171875 | 711.914062500 |
| 2 | 1920 | 1080 | 50 | 3 | 296.63085938 | 1067.871093756 |
| 5 | 1920 | 1080 | 40 | 3 | 237.30468750 | 1352.636718756 |
| 6 | 704 | 480 | 20 | 3 | 19.33593750 | 1375.839843756 |
| 7 | 704 | 480 | 20 | 3 | 19.33593750 | 1399.042968756 |
| 8 | 1920 | 1080 | 20 | 3 | 118.65234375 | 1541.425781256 |
| 9 | 704 | 480 | 20 | 3 | 19.33593750 | 1564.628906256 |
| 10 | 704 | 480 | 20 | 3 | 19.33593750 | 1587.832031256 |
| 11 | 640 | 480 | 20 | 1 | 5.85937500 | 1594.863281256 |
| 12 | 480 | 360 | 20 | 1 | 3.29589844 | 1598.818359384 |
| 13 | 2560 | 1920 | 110 | 4 | 2062.50000000 | 4073.818359384 |
| 14 | 2560 | 1920 | 121 | 4 | 2268.75000000 | 6796.318359384 |
| 15 | 640 | 480 | 20 | 4 | 23.43750000 | 6824.443359384 |
+----+-------+--------+------------------+---------+---------------+---------------------+
13 rows in set (3.46 sec)