Samuel Maynard 11765d696c feat(general): reduce number of open file descriptors for indexes on Unix (#4866)
Close file after mmap on Unix to reduce open file descriptors.

On Unix-like platforms, close the file descriptor immediately after a successful
mmap.Map of .sndx index cache files. This keeps the mapping valid until Unmap
(per POSIX semantics) and significantly reduces steady-state FD usage when many
indexes are open, helping avoid EMFILE ("too many open files").

- Split mmapOpenWithRetry into platform-specific implementations:
  - committed_content_index_disk_cache_unix.go (!windows):
    - Map RDONLY, close FD immediately.
    - Return closer that only unmaps.
  - committed_content_index_disk_cache_windows.go (windows):
    - Keep FD open until Unmap.
    - Return closer that unmaps and closes FD.
- Remove old mmapOpenWithRetry and mmap import from
  repo/content/committed_content_index_disk_cache.go.
- Add Linux-only unit test verifying FD count does not grow proportionally:
  repo/content/committed_content_index_fd_linux_test.go
  - Creates N small indexes, opens them all, checks /proc/self/fd delta stays low.

Notes:
- Behavior unchanged on Windows due to OS semantics.
- Mapping failures close the FD to avoid leaks.
- Unlink semantics remain correct; mappings stay valid until Unmap.

* remove windows only retry logic under unix
2025-10-22 21:16:35 -07:00
2023-07-22 12:53:23 -07:00
2025-06-10 17:24:14 -07:00
2025-06-10 17:24:14 -07:00
2020-02-05 21:38:16 -08:00
2016-06-12 17:09:12 -07:00

Kopia

Kopia Build Status Slack GoDoc Coverage StatusGo Report Card Contributor Covenant Docker Pulls Downloads Gurubase

n.

  1. copy, replica (Polish)
  2. lance, spear
  3. fast and secure backup tool

Kopia is a fast and secure open-source backup/restore tool that allows you to create encrypted snapshots of your data and save the snapshots to remote or cloud storage of your choice, to network-attached storage or server, or locally on your machine. Kopia does not 'image' your whole machine. Rather, Kopia allows you to backup/restore any and all files/directories that you deem are important or critical.

Kopia has both CLI (command-line interface) and GUI (graphical user interface) versions, making it the perfect tool for both advanced and regular users. You can read more about Kopia's unique features -- which include compression, deduplication, user-controlled end-to-end encryption, and error correction -- to get a better understanding of how Kopia works.

When ready, head to the installation page to download and install Kopia, and make sure to read the Getting Started Guide for a step-by-step walkthrough of how to use Kopia.

Pick the Cloud Storage Provider You Want

Kopia supports saving your encrypted and compressed snapshots to all of the following storage locations:

  • Amazon S3 and any cloud storage that is compatible with S3
  • Azure Blob Storage
  • Backblaze B2
  • Google Cloud Storage
  • Any remote server or cloud storage that supports WebDAV
  • Any remote server or cloud storage that supports SFTP
  • Some of the cloud storage options supported by Rclone
    • Requires you to download and setup Rclone in addition to Kopia, but after that Kopia manages/runs Rclone for you
    • Rclone support is experimental: not all the cloud storage products supported by Rclone have been tested to work with Kopia, and some may not work with Kopia; Kopia has been tested to work with Dropbox, OneDrive, and Google Drive through Rclone
  • Your local machine and any network-attached storage or server
  • Your own server by setting up a Kopia Repository Server

And Kopia uses data deduplication to save you money! Read the repositories help page for more information on supported storage locations.

With Kopia you are in full control of where to store your snapshots, that is, you pick the storage provider you want to use. You must provision and pay for the storage provider for whatever storage locations you want to use, and then tell Kopia what those storage locations are. You can even use multiple storage locations for different backup repositories if you want. Kopia also supports backing up multiple machines to the same storage location.

Kopia in Action

Using Kopia via command-line interface:

asciicast

Using Kopia via graphical user interface (note: the video is of an older version of Kopia and the interface is different in the current version of Kopia, but the main principles of the interface are the same):

Kopia UI Tutorial

Getting Started

See Kopia Documentation for more information.

Building Kopia

See Build Infrastructure for more information on building Kopia and working with the source code.

Licensing

Kopia is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Contribution Guidelines

Kopia is open source and contributions are welcome. For more information on how to contribute see the Contribution Guidelines.

Reporting Security Issues

If you find a security issue you'd like to disclose privately, please contact security@kopia.io or via direct message to maintainers on Slack.

Netlify Status

Description
No description provided
Readme 54 MiB
Languages
Go 97.3%
JavaScript 1%
Makefile 0.8%
Shell 0.6%
HTML 0.3%