I have a question regarding Laravel Octane's rows, bytes, and tables.
'cache' => [
'rows' => 1000,
'bytes' => 10000,
],
Why do we have to limit the number of rows and bytes in the Laravel Octane config file? Can't they be unlimited like other databases, such as MySQL?
How does Swoole determine the byte limit? Is it calculated by strlen
under the hood? How can we avoid the "unable to allocate memory" exception? Is this exception related to the byte limitation? Whenever this exception occurs, I have to restart my Docker container to prevent the error from happening again.
'tables' => [
'example:1000' => [
'name' => 'string:1000',
'votes' => 'int',
],
],
Cache::store('octane')->put()
and the tables
key in the config file? In the example provided in the config file (string:1000), what does :1000 mean?Unable to allocate memory
is because your data Key and Hash conflict rate is more than 20%, the reserved conflict memory block capacity is insufficient, set new data will report Unable to allocate memory error and return false, storage failure, then you need to increase the $size value and restart the service.The total memory occupied by Table is (HashTable structure length + KEY length 64 bytes + $size value) * (1 + $conflict_proportion value as hash conflict) * (column size).
tables for Octane::table('example').
Hope I can help you.