dosubot[bot] commented on issue #2474:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2474#issuecomment-1985165017

   <!-- Answer -->
   To manually trigger compaction in Apache HugeGraph, you can use the 
following API endpoint:
   
   ```
   PUT http://localhost:8080/graphs/hugegraph/compact
   ```
   
   This endpoint will trigger a compaction operation on the graph database. 
Please replace `localhost:8080` with your actual server address and port, and 
`hugegraph` with your actual graph name.
   
   Regarding your questions about RocksDB:
   
   1. **Why RocksDB is not automatically triggering compaction for several 
days:** Automatic compaction in RocksDB is influenced by several options such 
as `COMPACTION_STYLE`, `MAX_BG_JOBS`, and `LEVELS_COMPRESSIONS`. If compaction 
is not occurring as expected, it could be due to the configuration of these 
options. For example, a high number of background jobs (`MAX_BG_JOBS`) with 
insufficient system resources could delay compaction processes.
   
   2. **What options are available in `RocksdbOption` to control compaction 
thresholds, disk space, or WAL log size:** You can adjust `COMPACTION_STYLE` 
and `NUM_LEVELS` to control how and when compaction occurs. Use 
`MAX_TOTAL_WAL_SIZE` to control the total size of WAL files. Setting this to a 
lower value can help in managing disk space usage by triggering flushes and 
compactions more aggressively.
   
   3. **If I want to manually delete expired data stored by RocksDB from the 
disk, how should I proceed to avoid accidental deletion:** To safely delete 
expired data, ensure that your compaction strategy effectively removes obsolete 
data. Use `DELETE_OBSOLETE_FILE_PERIOD` to control how frequently obsolete 
files are purged. Setting this option to a lower value can help in more 
aggressively cleaning up expired data. However, manual intervention or direct 
interaction with RocksDB might be necessary for specific data deletion 
scenarios, as the provided API options focus on general configuration and do 
not directly expose data deletion methods.
   
   Please refer to the 
[RocksDBOptions.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBOptions.java)
 file for more details on these options.
   
   Remember, adjusting these settings requires a good understanding of your 
application's workload and how RocksDB's internal mechanisms work. Improper 
configuration can lead to performance degradation or increased disk usage. 
Always test changes in a staging environment before applying them to production.
   
   ## Sources
   - 
[hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBOptions.java](https://github.com/apache/incubator-hugegraph/blob/master/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBOptions.java)
   - 
[content/en/docs/clients/restful-api/graphs.md](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/clients/restful-api/graphs.md)
   
   <!-- Dosu Comment Footer -->
   <details>
   <summary>
   
   #### About Dosu
   </summary>
   
   This response is meant to be useful and save you time. It is **not meant to 
be a precise solution**, but rather a starting point for your own research.
   
   Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is 
irrelevant.
   
   If you want to continue the conversation, start your reply with @dosu-bot.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to