# Create a metric (note that there is only one `host` in `tags`; however, if there are new fields in the written data, they will be automatically put in `tags` as tags)curl -u {user}:{passwd} -XPUT {ctsdb_ip_port}/_metric/testa10?pretty -d '{"tags": {"http_code": "string"},"fields": {"count1":"long","count2":"long","count3":"long","count4":"long","count5":"long","count6":"long","count7":"long","count8":"long","count9":"long","count10":"long"},"time": {"name": "timestamp","format": "epoch_second"},"options": {"expire_day": -1,"refresh_interval": "10s","number_of_shards": 3,"number_of_replicas": 1,"rolling_period": -1}}'# Query a metriccurl {ctsdb_ip_port}/_metric/testa10?pretty# Delete a metric (all corresponding data will also be deleted)curl -XDELETE {ctsdb_ip_port}/_metric/testa10
{ctsdb_ip_port}
is the access port of CTSDB, {user}
the username, and {passwd}
the password.- db_url stringInstance VIP and Vport (example: 10.02.36.89:9200)- metric_name stringName of the metric to be written- data_num intNumber of records to be written by the client at a time- threads_nmb intNumber of concurrent writes- counts intNumber of fields in a record
userpwd
in line 18 in the script before running it.python testa.py 10.0.1.10:9200 testa10 4000 9 10
params
(option parameters) and results
(final results).-------------- params --------------put_url http://10.0.1.10:9200/testa10/doc/_bulkdataNum: 4000threads_nmb: 9counts: 10-------------- results --------------start all threads 2018-12-25 20:10:24exit all threads 2018-12-25 20:10:24startTime: 1545739824.51endTime: 1545739824.55diffTime: 0.0414531230927wps: 158450.850363
wps
field.Single Node Configuration | Number of Nodes | Write Capacity |
1 CPU core and 4 GB memory | 3 | 30,000–50,000 data points per second |
4 CPU cores and 20 GB memory | 3 | 90,000–120,000 data points per second |
8 CPU cores and 40 GB memory | 3 | 110,000–150,000 data points per second |