This time, my Aerospike instance run in a single workstation PC, with a single thread that keeps read/write/delete records, the program reads data and write-update to existing records and won’t write to new records. disk write keeps in 200-300MBps. Before it fails, the defrag-q keep increasing (129627->138439-> 149446), and contig-free drops sharply (5G->3G->1.5G->75M), then the Java client throws
ERROR com.aerospike.client.AerospikeException:
Error Code 8: Server memory error
at com.aerospike.client.command.WriteCommand.parseResult (WriteCommand.java:59)
This is a development system, hardware is not server-grade, and I mainly view it as an opportunity to learn about Aerospike’s behavior and limitation. My questions are:
- Apparently, the system can’t defrag the write blocks fast enough. And then there is not enough free write blocks to write data. Is it a correct description? The solution is to configure defragmentation to run more frequently? There is another forum thread talk about it in details.
- Server memory error refers to
contig-free
? ordefrag-q
? or both?defrag-q
is hold in memory. obviously, ifcontig-free
drops to near 0, it makes sense to get error, but shouldn’t be called memory error?! - For
defrag-q
, unlikew-q
, there seems to be no option to configure max size ofdefrag-q
? except in my case that my data write to existing blocks, increment of defrag-q does no harm except risk of data loss when server crashes? if there is no configurable/hard limit, will it just consume all the system RAM? (there are a lot of free memory in this case)
Thanks.
Reference - doc
contig-free: Amount of space occupied by free wblocks, and the number of wblocks free in parenthesis
defrag-q: Number of wblocks pending defrag
Reference - log
Nov 10 2014 10:17:37 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5230367744, contig-free 4955M (19823 wblocks), swb-free 8, n-w 0, w-q 0 w-tot 2550474 (354.2/s), defrag-q 129627 defrag-tot 2535305 (357.5/s)
Nov 10 2014 10:17:57 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5225796224, contig-free 3907M (15630 wblocks), swb-free 8, n-w 0, w-q 0 w-tot 2561988 (575.7/s), defrag-q 133842 defrag-tot 2546832 (576.3/s)
Nov 10 2014 10:18:17 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5220899328, contig-free 2778M (11115 wblocks), swb-free 8, n-w 0, w-q 0 w-tot 2574351 (618.2/s), defrag-q 138439 defrag-tot 2559266 (621.7/s)
Nov 10 2014 10:18:37 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5217150592, contig-free 2008M (8034 wblocks), swb-free 8, n-w 0, w-q 0 w-tot 2583777 (471.3/s), defrag-q 141543 defrag-tot 2568708 (472.1/s)
Nov 10 2014 10:18:57 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5214418560, contig-free 1438M (5754 wblocks), swb-free 8, n-w 0, w-q 0 w-tot 2590680 (345.1/s), defrag-q 143879 defrag-tot 2575658 (347.5/s)
Nov 10 2014 10:19:17 GMT: INFO (drv_ssd): (drv_ssd.c::2359) device /ssd/aerospike/aibo.db: used 5208543488, contig-free 75M (303 wblocks), swb-free 9, n-w 0, w-q 0 w-tot 2605512 (741.6/s), defrag-q 149446 defrag-tot 2590599 (747.0/s)