question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Mounting symlink'd index.sqlite3 on SSD when using docker-compose

See original GitHub issue

Hello,

I’ve tried many ways to make it work, but I can’t achieve to have the database hosted outside of the /data directory. I’m running the project on ZFS (hard drives), the performance is O.K, but it start to get slow on the DB side, and when trying to add multiple links error 500 starts occurring. You suggest running the database at the least on SSD https://github.com/ArchiveBox/ArchiveBox#storage-requirements , but doesn’t seem to work with docker-compose, or I’m unable to mount it properly.

version: '2.4'   # '3.9' or greater also works

services:
    archivebox:
        # build: .                              # for developers working on archivebox
        image: ${DOCKER_IMAGE:-archivebox/archivebox:master}
        command: server --quick-init 0.0.0.0:8000
        ports:
            - 8000:8000
        environment:
            - ALLOWED_HOSTS=*                   # add any config options you want as env vars
            - SAVE_MEDIA=False
            #- MEDIA_MAX_SIZE=750m
            # - SEARCH_BACKEND_ENGINE=sonic     # uncomment these if you enable sonic below
            # - SEARCH_BACKEND_HOST_NAME=sonic
            # - SEARCH_BACKEND_PASSWORD=SecretPassword
        volumes:
            - /docker/archivebox/data:/data

My home directory is an NVMe SSD, I would like to have the index.sqlite3 on /home/user/data/index.sqlite3

Tried symbolic link, but does fail. Compose doesn’t start, looping errors. Tried to add a volume like this, but keeps recreating the database from scratch.

 volumes:
            - /docker/archivebox/data:/data
            - /home/user/data/index.sqlite3:/data/index.sqlite3

Any proper way of mounting it?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
akhilleusuggocommented, Apr 13, 2022

@pirate I don’t want to reopen the issue, but your last example logically works, but when it comes to running the database, how would I do that?

How can I tell Archivebox that the database (index.sqlite3) is mounted on /media/someSSD/archivebox/index.sqlite and not on the default location data/index.sqlite3

Just by creating a symbolic link, doesn’t mean the data will be written to the location of the symlink. Will still be written on the default /data/index.sqlite3 witch I have on spinning drives with ZFS (compression/dedup ON), and you know performance is horrible compared to without.

Your example maybe was meant to fix the docker symlink issue; but not Archivebox issue.

If more than 1 project has a database that requires mounting on /data/index.sqlite3, this solution will not work. I’m not saying that archivebox issue, but would be nice if we had a variable to point where the database is located.

I know that maybe the last resort would that each one would be rebuilding the image to reflect the location where he wants to store the db.

0reactions
akhilleusuggocommented, Mar 16, 2022

Ok, I see what you mean. Like a reverse symlink. Thank you, I’ll try this way out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mount host directory with a symbolic link inside in docker ...
But a symlink created inside docker container work just fine. So, it is a good idea to mount the root (with absolute path)...
Read more >
Docker Compose - PhotoPrism
we recommend placing the storage folder on a local SSD drive for best performance; mounting symbolic links or using them inside the storage...
Read more >
Consider SQLite | Hacker News
We've been using SQLite in production as our exclusive means for getting bytes ... have reasonable hardware (NVMe/SSD) and utilize appropriate configuration ...
Read more >
Tutoriel Docker - Read the Docs
Simple continuous deployment with docker compose, docker machine and ... 23.6.2.6.2 Step 2: Mount the configuration as a volume .
Read more >
Diskover Installation Guide
Introduction. An unparalleled data management solution, Diskover consolidates in a global index unstructured data spread across heterogeneous repositories.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found