Solr Driver for SBK Framework
This driver provides performance benchmarking capabilities for Apache Solr within the SBK framework.
Overview
Apache Solr is a powerful search platform built on Apache Lucene. This driver allows you to benchmark Solr’s performance for various operations including indexing and searching documents.
Features
- Document Indexing: Benchmark document insertion performance
- Document Retrieval: Benchmark search and retrieval performance
- SolrCloud Support: Works with SolrCloud using ZooKeeper
- Batch Operations: Configurable batch sizes for improved performance
- Configurable Commit: Configurable commit within time for write operations
Configuration
The Solr driver can be configured using the following parameters:
| Parameter |
Description |
Default Value |
zookeeperHost |
ZooKeeper host for SolrCloud |
localhost |
zookeeperPort |
ZooKeeper port for SolrCloud |
2181 |
collection |
Solr collection name |
sbk_benchmark |
solrUrl |
Direct Solr URL (for standalone mode) |
http://localhost:8983/solr |
username |
Solr username (optional) |
"" |
password |
Solr password (optional) |
"" |
batchSize |
Number of documents per batch |
100 |
commitWithinMs |
Commit within time in milliseconds |
1000 |
Prerequisites
- Solr Installation: Ensure you have Apache Solr 8.x or later installed and running
- SolrCloud Mode: For distributed benchmarks, set up SolrCloud with ZooKeeper
- Java: Java 8 or later required
- Network Access: Ensure the SBK framework can access your Solr instance
Setting up SolrCloud
- Download and extract Apache Solr
- Start Solr in cloud mode:
./bin/solr start -c -p 8983 -s example/cloud/node1/solr -z localhost:2181
- Create a collection (optional, the driver will create it if it doesn’t exist):
./bin/solr create -c sbk_benchmark -shards 1 -replicationFactor 1
Document Structure
The driver stores documents with the following fields:
id: Unique document identifier (generated by SBK)
data: The actual data being benchmarked
timestamp: Document insertion timestamp
- Batch Size: Larger batch sizes generally improve write performance but use more memory
- Commit Settings: Longer commit within times improve performance but may affect data visibility
- Solr Configuration: Ensure your Solr instance is properly tuned for your workload
- Network Latency: Consider network latency between SBK and Solr instances
Troubleshooting
Common Issues
- Connection Failed: Ensure Solr is running and accessible from the SBK framework
- Collection Not Found: The driver will attempt to create the collection automatically
- Authentication Errors: Verify username and password if authentication is enabled
Logging
Enable debug logging to troubleshoot issues:
./gradlew run -PmainClass=io.sbk.app.Main --args="--storage solr --records 1000 --debug"
Dependencies
- Apache Solr SolrJ 8.11.2
- SBK API
License
This driver is licensed under the Apache License 2.0.
Contributing
To contribute to this driver:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Support
For issues and questions:
- Check the SBK framework documentation
- Review Apache Solr documentation at https://solr.apache.org/
- Open an issue on the SBK GitHub repository