Skip to content
feiben edited this page Mar 24, 2016 · 39 revisions

We perform tests on a cheap cloud machine, 1-core 2.6GHz Intel Xeon CPU, 2.0 G memory and 100GB HDD, without SSD acceleration. We put Swap files on a separate directory for the use of Lunar virtual memory. Here is what the system configured:

CPU:

[rocku@iz25damtesuZ ~]$ cat /proc/cpuinfo  
vendor_id        :  GenuineIntel  
cpu family       :  6  
model            :  62  
model name       :  Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz  
stepping         :  4  
cpu MHz          :  2593.427  
cache size       :  20480 KB  
......    

Memory:

[rocku@iz25damtesuZ ~]$ grep MemTotal /proc/meminfo  
MemTotal:        : 1920740KB  

LunarBase has real-time mode and virtual memory enabled, full index mode disabled, and the maximum physical memory use for each searchable column will be 256MB = 1<<28, and maximum 256k = 1 << 18 hot records will be keep in cache:

#....................#
cache_records_in_memory = 18

#....................#
full_index_mode = off  
rt_mode = on    
rt_mem_page_size = 12    
rt_virtual_mem_enabled = on  
rt_max_memory = 28  
rt_max_virtual_pte = 12  
rt_vm_swap = /data/rocku/DBTest/Swap  

The testing data set has 5,000,000 order records, 1,000,000 users and 100,000 products. Join user data and order data by denormalizing columns into a materialized view named user_order_view. Then the view has joined columns name, payment, product, time_stemp, age, degree, address, favorite, score, among which name, payment and product are searchable.

Actually it is a materialized view of two tables order and user

Here is the system status when the test was running:

Cpu(s): 67.1%us, 34.2%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st,    
Mem:    1920740k total, 1850736k used, 70308k free,   14932k buffers    
Swap:         0k total,       0k used,     0k free,  601032k cached  

Be noticed, here the Swap printed out is the Linux Swap, not the LunarBase Swap.

PID    USER        PR NI    VIRT   RES   SHR  S  %CPU  %MEM  
18400  rocku       20  0   4464m  719m  5488  S  99.2  38.3  

Since we have 3 searchable columns, and each has memory limitation 256MB, so the total physical memory use is 719MB in this test.

#Report of Insert:

dbname = /data/rocku/DBTest/RTSeventhDB  
total records = 5,000,000  
maximum 5000 insert takes 1138625519 ns  
minimum 5000 insert takes 94372679 ns  
average 5000 insert takes 395830329 ns
total time: 395.8303 s  

Apparently, more searchable columns costs more time to insert.

#Report of range query and point query:

dbname = /data/rocku/DBTest/RTSeventhDB  
search table = order_user_view   
search columns = payment, name, product  
total records = 5,000,000  
average records in range = 1236 recs  
total searches = 25,000,000  
search result having maximum 1500 records takes(ms):  2981.41255 (ms)
average range query costs(ms):  25.0063029 (ms)  
average point query costs(ms):  0.016008400 (ms)   

Clone this wiki locally