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

./run.py problem #31

Open
zjthappy opened this issue Jul 12, 2023 · 20 comments
Open

./run.py problem #31

zjthappy opened this issue Jul 12, 2023 · 20 comments
Assignees

Comments

@zjthappy
Copy link

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ./run.py
Traceback (most recent call last):
File "./run.py", line 164, in
def main(db_names: Optional[list[str]] = supported_db_names,
TypeError: 'type' object is not subscriptable

@ashvardanian
Copy link
Contributor

@zjthappy thanks for the feedback!
@DarvinHarutyunyan and @mgevor, please take a look at this 🤗

@zjthappy
Copy link
Author

@zjthappy thanks for the feedback! @DarvinHarutyunyan and @mgevor, please take a look at this hugs

it seems beacuse of the version of python,i use python3.9 instead
but a new problem appear:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 run.py
Cleanup...
Traceback (most recent call last):
File "/home/zjt/ycsb/ucsb/run.py", line 221, in
fire.Fire(main)
File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/usr/local/lib/python3.9/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/home/zjt/ycsb/ucsb/run.py", line 217, in main
run(db_name, size, workload_names, main_dir_path, storage_disk_paths, transactional, drop_caches, run_docker_image, threads_count)
File "/home/zjt/ycsb/ucsb/run.py", line 131, in run
process = pexpect.spawn(f'{runner}
File "/usr/local/lib/python3.9/site-packages/pexpect/pty_spawn.py", line 205, in init
self._spawn(command, args, preexec_fn, dimensions)
File "/usr/local/lib/python3.9/site-packages/pexpect/pty_spawn.py", line 276, in _spawn
raise ExceptionPexpect('The command was not found or was not ' +
pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: ./build_release/build/bin/ucsb_bench.

@mgevor
Copy link
Contributor

mgevor commented Jul 13, 2023

Hi @zjthappy, please pull main-dev branch.
There are some fixes there which haven't been merged into main yet.

@zjthappy
Copy link
Author

Is there any requirement for the compiler version when compiling?

@mgevor
Copy link
Contributor

mgevor commented Jul 13, 2023

Both gcc-10 and gcc-11 are tested and compile fine.

@zjthappy
Copy link
Author

Is there a detailed tutorial, such as how to set parameters. I want to test the performance of redis

@ashvardanian
Copy link
Contributor

I have merged a bunch of updates into main. As for Redis, @davvard may be the most experienced person on our side. Any specific recommendations on how to run the benchmarks?

@mgevor
Copy link
Contributor

mgevor commented Jul 13, 2023

@zjthappy, you are able to change the benchmark's parameters in the run.py script, or you can pass the parameters in the terminal.
e.g. sudo ./run.py -db redis -sz 100MB -wl Init Read
See the script for more options.

@zjthappy
Copy link
Author

Thank you for your answers.
I ran the instructions and there seems to be something wrong. The output is as follows:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 run.py -db redis -sz 100MB -wl Init,Read
Failed to load workloads. path: ./bench/workloads/1.json
Failed to load workloads. path: ./bench/workloads/1.json
Failed to load workloads. path: ./bench/workloads/1.json
Failed to load workloads. path: ./bench/workloads/1.json
[✱] Dropping system caches...

And I am a bit confused, how to specify the address and port of redis

@mgevor
Copy link
Contributor

mgevor commented Jul 13, 2023

I'm sorry, it had a bug, now you can pull the fix from main-dev.

Please follow the instruction:

  1. Enable database in CMakeList.txt if it isn't enabled by default:
    set flag ON here: option(UCSB_BUILD_REDIS "Build Redis for the benchmark" OFF)
  2. Build benchmark:
    ./build_release.sh
  3. Run:
    sudo ./run.py -db redis -sz 100MB -wl Init Read BatchRead

@davvard
Copy link
Contributor

davvard commented Jul 13, 2023

@zjthappy When you run run.py with "-sz 100MB" argument, Redis is using ./bench/configs/redis/100MB.cfg config file where you can change the port.

@zjthappy
Copy link
Author

ok Thank you all

I'll give it another try and I'll give feedback if I have any problems with it

@ashvardanian
Copy link
Contributor

Hey, @zjthappy ! Is it resolved now? Can we close the issue?

@zjthappy
Copy link
Author

Hello! I pull main branch.

  1. I Enable Redis in CMakeList.txt

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" ON)
option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" ON)
option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" ON)
option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" ON)
option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF)
option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON)
option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

  1. I Build benchmark: ./build_release.sh
  2. Run:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead
Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

I don't know why it fails......
my operating environment:
ubuntu-20.04
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
Python 3.9.15

@ashvardanian
Copy link
Contributor

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

@zjthappy zjthappy reopened this Aug 15, 2023
@zjthappy
Copy link
Author

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

I tried deleting cmake's output directory build_release, and then to speed up compilation only selected redis, but it still fails

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" OFF)
option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" OFF)
option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" OFF)
option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" OFF)
option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF)
option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON)
option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead
Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

Then I used the compiled binary build_release/build/bin/ucsb_bench directly,another problem appears:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo build_release/build/bin/ucsb_bench -db redis -cfg bench/configs/redis/100MB.cfg -md ./db_main/redis/100MB/ -wl ./bench/workloads/100MB.json -res bench/results/transactional/cores_15/disks_1/redis/
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 |
+------------------------------------------------------------------------------------------------------------------------------------------------+
sh: 1: redis-server: not found
sh: 1: redis-cli: not found
std exception: Failed to connect to Redis: No such file or directory

but my redis is ok:

zjt@zjt-ThinkBook-16-G4-IAP:~$ ps -ef | grep redis
zjt 7401 1987 0 09:42 ? 00:00:59 ./src/redis-server 127.0.0.1:6379

@mgevor
Copy link
Contributor

mgevor commented Aug 29, 2023

I'm sorry, it had a bug, now you can pull the fix from main-dev.

Please follow the instruction:

  1. Enable database in CMakeList.txt if it isn't enabled by default:
    set flag ON here: option(UCSB_BUILD_REDIS "Build Redis for the benchmark" OFF)
  2. Build benchmark:
    ./build_release.sh
  3. Run:
    sudo ./run.py -db redis -sz 100MB -wl Init Read BatchRead

Update: When you make changes in the ./CMakeList.txt you need to delete ./build_release/CMakeCache.txt cache file before running ./build_release.sh script, so you don't need to delete the whole ./build_release/ folder

@mgevor
Copy link
Contributor

mgevor commented Aug 29, 2023

CMake caches older configs. Any chance you have previously run without Redis and hasn't cleaned the caches since?

I tried deleting cmake's output directory build_release, and then to speed up compilation only selected redis, but it still fails

option(UCSB_BUILD_USTORE "Build USTORE for the benchmark" OFF)
option(UCSB_BUILD_ROCKSDB "Build RocksDB for the benchmark" OFF)
option(UCSB_BUILD_LEVELDB "Build LevelDB for the benchmark" OFF)
option(UCSB_BUILD_WIREDTIGER "Build WiredTiger for the benchmark" OFF)
option(UCSB_BUILD_MONGODB "Build MongoDB for the benchmark" OFF)
option(UCSB_BUILD_REDIS "Build Redis for the benchmark" ON)
option(UCSB_BUILD_LMDB "Build LMDB for the benchmark" OFF)

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead
Failed to create DB: redis (probably it's disabled in CMaleLists.txt)

Then I used the compiled binary build_release/build/bin/ucsb_bench directly,another problem appears:

zjt@zjt-ThinkBook-16-G4-IAP:~/ucsb$ sudo build_release/build/bin/ucsb_bench -db redis -cfg bench/configs/redis/100MB.cfg -md ./db_main/redis/100MB/ -wl ./bench/workloads/100MB.json -res bench/results/transactional/cores_15/disks_1/redis/
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 |
+------------------------------------------------------------------------------------------------------------------------------------------------+
sh: 1: redis-server: not found
sh: 1: redis-cli: not found
std exception: Failed to connect to Redis: No such file or directory

but my redis is ok:

zjt@zjt-ThinkBook-16-G4-IAP:~$ ps -ef | grep redis
zjt 7401 1987 0 09:42 ? 00:00:59 ./src/redis-server 127.0.0.1:6379

@davvard could you please help @zjthappy to setup redis?

@davvard
Copy link
Contributor

davvard commented Aug 29, 2023

Hi @zjthappy! Can you please kill the redis-server process, run the "redis-server" command in your terminal, and check if it works?

@zjthappy
Copy link
Author

zjthappy commented Sep 4, 2023

Hi @zjthappy! Can you please kill the redis-server process, run the "redis-server" command in your terminal, and check if it works?

@davvard First I started redis:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ redis-server ~/redis-5.0.5/redis.conf

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis
zjt 4370 1986 0 11:48 ? 00:00:00 redis-server *:6379
zjt 4454 2924 0 11:50 pts/2 00:00:00 grep --color=auto redis

I also modified the ucsb-redis connection configuration:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ cat ./bench/configs/redis/100MB.cfg
{
"connection_type": "UNIX",
"path": "./db_main/redis/100MB/redis.sock",
"host": "127.0.0.1",
"port": 6379,
"pool_size": 64,
"wait_timeout": 10
}

Then I run ucsb,it fails:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 |
+------------------------------------------------------------------------------------------------------------------------------------------------+
sh: 1: redis-server: not found
sh: 1: redis-cli: not found
std exception: Failed to connect to Redis: No such file or directory

I try to kill redis process,and start redis again:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ kill -9 4370

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis
zjt 4764 2924 0 11:57 pts/2 00:00:00 grep --color=auto redis

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ redis-server ~/redis-5.0.5/redis.conf

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ ps -ef | grep redis
zjt 4771 1986 0 11:57 ? 00:00:00 redis-server 127.0.0.1:6379
zjt 4789 2924 0 11:57 pts/2 00:00:00 grep --color=auto redis

then try ucsb again,it still fails:

zjt@zjt-ThinkBook-16-G4-IAP:~/ycsb/ucsb$ sudo python3.9 ./run.py -db redis -sz 100MB -wl Init Read BatchRead
+------------------------------------------------------------------------------------------------------------------------------------------------+
| Database: redis | Workload size: 97.66MB | Threads: 1 | Disks: 1 |
+------------------------------------------------------------------------------------------------------------------------------------------------+
sh: 1: redis-server: not found
sh: 1: redis-cli: not found
std exception: Failed to connect to Redis: No such file or directory

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

No branches or pull requests

5 participants