Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOTDB-23] Restart state monitor module #1725

Merged
merged 37 commits into from Nov 24, 2020

Conversation

Alima777
Copy link
Contributor

@Alima777 Alima777 commented Sep 11, 2020

You can find the detail in [1].
[1] https://lists.apache.org/list.html?dev@iotdb.apache.org:lte=1M:Restart

Currently, the status monitor module of iotdb is abandoned and not maintained now. It's time for us to restart this module.

Before, it was designed including two child modules: 1. the writing data status monitor and 2. the file size monitor.

  1. The writing data monitor module is responsible for collecting writing data statistics.

Actually, many parts of origin design are redundant and not meaningful for users. Therefore, I want to just keep TOTAL_POINTS here and remove others. And i did not come up with some good ideas about what needs to be added to this monitor while writing data. Welcome to any ideas here!

  1. The file size monitor is concerned about how much space the data file takes. It's supported partly and very limited now.

I want to just remove it from iotdb.

I used the benchmark to do the performance test, using the default IoTDB configuration while 8G machine memoery , the benchmark configuration is:
----------------------Main Configurations----------------------
DB_SWITCH: IoTDB
OPERATION_PROPORTION: 1:0:0:0:0:0:0:0:0
ENABLE_THRIFT_COMPRESSION: false
INSERT_DATATYPE_PROPORTION: 1:1:1:1:1:1
ENCODING(BOOLEAN/INT32/INT64/FLOAT/DOUBLE/TEXT): PLAIN/PLAIN/PLAIN/PLAIN/PLAIN/PLAIN
IS_CLIENT_BIND: true
CLIENT_NUMBER: 20
GROUP_NUMBER: 10
DEVICE_NUMBER: 10
SENSOR_NUMBER: 100
BATCH_SIZE: 100
LOOP: 100000
POINT_STEP: 5000
QUERY_INTERVAL: 250000
IS_OVERFLOW: false
OVERFLOW_MODE: 0
OVERFLOW_RATIO: 0.5

The result is:

| Close monitor | Open monitor without writing timeseries | Open Monitor with writing time series |
| 1048.83 ms | 1049.40ms | 1064.90ms |
| | - 0.05% | -3% |

Copy link
Member

@jixuan1989 jixuan1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some logic should refined:

We need to consider the case that the status of enableMonitor can be switched while IoTDB instance does not restart.
So, the recovery() and init() (create timeseries) should be called by StatMonitor itself.

Copy link
Contributor

@HTHou HTHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more clear user guide is necessary for this module.

Copy link
Contributor

@HTHou HTHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pulled this pr and tried to use the monitor module on my local machine.
Looks good.

@HTHou
Copy link
Contributor

HTHou commented Nov 23, 2020

Plz fix the conflict.

@Alima777
Copy link
Contributor Author

Plz fix the conflict.

Fixed.

@jixuan1989
Copy link
Member

Data Monitoring

This module is for providing some statistics info about the writing operations:

  • the data size (in bytes) in IoTDB, the number of data points in IoTDB;
  • how many operations are successful or failed executed.

Enable/disable the module

Users can choose to enable or disable the feature of data statistics monitoring (set the enable_stat_monitor item in the configuration file).

Statistics Data Storing

By default, the statistics data is only saved in memory and can be accessed using Jconsole.

The data can also be written as some time series on disk. To enable it, set enable_monitor_series_write=true in the configuration file. If so, using select statement in IoTDB-cli can query these time series.

Note:
if enable_monitor_series_write=true, when IoTDB is restarted, the previous statistics data will be recovered into memory.
if enable_monitor_series_write=false, IoTDB will forget all statistics data after the instance is restarted.

Writing Data Monitor

At present, the monitor system can be divided into two modules: global writing statistics and storage group writing statistics. The global statistics records the number of total points and requests, and the storage group statistics counts the write data of each storage group.

The system sets the collection granularity of the monitoring module to update the statistical information once one data file is flushed into the disk, so the data accuracy may be different from the actual situation. To obtain accurate information, Please call the flush method before querying.

@sonarcloud
Copy link

sonarcloud bot commented Nov 24, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 32 Code Smells

No Coverage information No Coverage information
0.3% 0.3% Duplication

@jixuan1989 jixuan1989 merged commit bf03882 into apache:master Nov 24, 2020
@HTHou HTHou mentioned this pull request Nov 25, 2020
@Alima777 Alima777 deleted the state_monitor branch December 2, 2020 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants