[GH-ISSUE #63] [Info] peerflix storage ? #267

Closed
opened 2026-03-15 02:43:39 +03:00 by kerem · 24 comments
Owner

Originally created by @yas9999 on GitHub (Feb 27, 2016).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/63

Hello,
i just wonder what peerflix use to store & stream files ?
it's RAM or HDD ?
there is any option to edit this part ? i mean change the way that peerflix use to serve files 👍

Best regards

Originally created by @yas9999 on GitHub (Feb 27, 2016). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/63 Hello, i just wonder what peerflix use to store & stream files ? it's RAM or HDD ? there is any option to edit this part ? i mean change the way that peerflix use to serve files :+1: Best regards
kerem 2026-03-15 02:43:39 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@asapach commented on GitHub (Feb 27, 2016):

By default the files are stored under /tmp/torrent-stream (or similar TEMP folder if you're on windows). You can change it by adding ~/.config/peerflix-server/config.json file and specifying tmp option, e.g. { "tmp": "/your/folder/here" }
If you're on linux and have lots of RAM you can try mounting a tmpfs partition as your storage.

<!-- gh-comment-id:189717713 --> @asapach commented on GitHub (Feb 27, 2016): By default the files are stored under `/tmp/torrent-stream` (or similar TEMP folder if you're on windows). You can change it by adding `~/.config/peerflix-server/config.json` file and specifying `tmp` option, e.g. `{ "tmp": "/your/folder/here" }` If you're on linux and have lots of RAM you can try [mounting a tmpfs partition](https://wiki.archlinux.org/index.php/Tmpfs) as your storage.
Author
Owner

@yas9999 commented on GitHub (Feb 28, 2016):

Hello thanks for information :D,
i'm under ubuntu 14.04 64bits with 2GB RAM !
but i want to use peerflix for huge traffic change, i guess RAM will not be a good choice ?

Regards,

<!-- gh-comment-id:189943134 --> @yas9999 commented on GitHub (Feb 28, 2016): Hello thanks for information :D, i'm under ubuntu 14.04 64bits with 2GB RAM ! but i want to use peerflix for huge traffic change, i guess RAM will not be a good choice ? Regards,
Author
Owner

@asapach commented on GitHub (Feb 28, 2016):

Yes, you're better off using an SSD.

<!-- gh-comment-id:189943241 --> @asapach commented on GitHub (Feb 28, 2016): Yes, you're better off using an SSD.
Author
Owner

@yas9999 commented on GitHub (Mar 27, 2016):

thank you so much, i will try to get a better server with SSD i wonder if i could use peerflix for multiple servers

<!-- gh-comment-id:202142120 --> @yas9999 commented on GitHub (Mar 27, 2016): thank you so much, i will try to get a better server with SSD i wonder if i could use peerflix for multiple servers
Author
Owner

@yas9999 commented on GitHub (Aug 4, 2016):

Hello @asapach ,
i still have the problem with RAM ! i got a server with 4 GB of RAM & 128 GB SSD
there is any solution to change the way that peerflix store files ?
ram

Best regards

<!-- gh-comment-id:237599357 --> @yas9999 commented on GitHub (Aug 4, 2016): Hello @asapach , i still have the problem with RAM ! i got a server with 4 GB of RAM & 128 GB SSD there is any solution to change the way that peerflix store files ? ![ram](https://cloud.githubusercontent.com/assets/5939771/17408931/0279391c-5a65-11e6-977c-6c26b7a00858.png) Best regards
Author
Owner

@asapach commented on GitHub (Aug 4, 2016):

What the problem is exactly? I see it's using ~3GB of memory for cache which is to be expected.

<!-- gh-comment-id:237607247 --> @asapach commented on GitHub (Aug 4, 2016): What the problem is exactly? I see it's using ~3GB of memory for cache which is to be expected.
Author
Owner

@yas9999 commented on GitHub (Aug 4, 2016):

thank you @asapach the problem is i can't add any new torrent even if the old torrents are downloaded,
do you thing i need to change something in my cache ?
there is any option to store in SSD instead of RAM (because you said before : you're better off using an SSD )

Best regards

<!-- gh-comment-id:237714125 --> @yas9999 commented on GitHub (Aug 4, 2016): thank you @asapach the problem is i can't add any new torrent even if the old torrents are downloaded, do you thing i need to change something in my cache ? there is any option to store in SSD instead of RAM (because you said before : you're better off using an SSD ) Best regards
Author
Owner

@asapach commented on GitHub (Aug 4, 2016):

What your config.json?

<!-- gh-comment-id:237714279 --> @asapach commented on GitHub (Aug 4, 2016): What your `config.json`?
Author
Owner

@yas9999 commented on GitHub (Aug 4, 2016):

there is no config.json inside ~/.config/peerflix-server/
there is only torrents.json

<!-- gh-comment-id:237717149 --> @yas9999 commented on GitHub (Aug 4, 2016): there is no config.json inside ~/.config/peerflix-server/ there is only torrents.json
Author
Owner

@yas9999 commented on GitHub (Aug 5, 2016):

i used the same option in config.json& this is what i get :
$ peerflix-server
info - socket.io started
(node:6153) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
undefined:2
connections: 100, // Max amount of peers to be connected to.
^

SyntaxError: Unexpected token c in JSON at position 6
at Object.parse (native)
at /usr/lib/node_modules/peerflix-server/server/store.js:93:22
at FSReqWrap.readFileAfterClose as oncomplete

<!-- gh-comment-id:237731651 --> @yas9999 commented on GitHub (Aug 5, 2016): i used the same [option](https://github.com/mafintosh/torrent-stream#full-api) in config.json& this is what i get : $ peerflix-server info - socket.io started (node:6153) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead. undefined:2 connections: 100, // Max amount of peers to be connected to. ^ SyntaxError: Unexpected token c in JSON at position 6 at Object.parse (native) at /usr/lib/node_modules/peerflix-server/server/store.js:93:22 at FSReqWrap.readFileAfterClose [as oncomplete](fs.js:445:3)
Author
Owner

@asapach commented on GitHub (Aug 5, 2016):

The error says your config is invalid JSON. You need to put quotes around the attributes like in this example: https://github.com/asapach/peerflix-server#configuration. And it doesn't support comments
What do you mean when you say:

i can't add any new torrent even if the old torrents are downloaded

<!-- gh-comment-id:237807036 --> @asapach commented on GitHub (Aug 5, 2016): The error says your config is invalid JSON. You need to put quotes around the attributes like in this example: https://github.com/asapach/peerflix-server#configuration. And it doesn't support comments What do you mean when you say: > i can't add any new torrent even if the old torrents are downloaded
Author
Owner

@yas9999 commented on GitHub (Aug 5, 2016):

yeah i mean that RAM still used even if the torrent is downloaded 100%, i had only 120 Mb free of RAM, so i can't add any new torrent.
i changed my config.json to:

{
"connections": 100,
"uploads": 10,
"path": "/var/www/html/tdown",
"verify": true,
"dht": true,

}

& i got this error:
$ peerflix-server info - socket.io started
(node:16364) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
undefined:8
}
^

SyntaxError: Unexpected token } in JSON at position 156
at Object.parse (native)
at /usr/lib/node_modules/peerflix-server/server/store.js:93:22
at FSReqWrap.readFileAfterClose as oncomplete

<!-- gh-comment-id:237833397 --> @yas9999 commented on GitHub (Aug 5, 2016): yeah i mean that RAM still used even if the torrent is downloaded 100%, i had only 120 Mb free of RAM, so i can't add any new torrent. i changed my config.json to: { "connections": 100, "uploads": 10, "path": "/var/www/html/tdown", "verify": true, "dht": true, } & i got this error: $ peerflix-server info - socket.io started (node:16364) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead. undefined:8 } ^ SyntaxError: Unexpected token } in JSON at position 156 at Object.parse (native) at /usr/lib/node_modules/peerflix-server/server/store.js:93:22 at FSReqWrap.readFileAfterClose [as oncomplete](fs.js:445:3)
Author
Owner

@asapach commented on GitHub (Aug 5, 2016):

You've got a trailing comma after "dht": true

On Aug 5, 2016 3:03 PM, "yas9999" notifications@github.com wrote:

yeah i mean that RAM still used even if the torrent is downloaded 100%, i
had only 120 Mb free of RAM, so i can't add any new torrent.
i changed my config.json to:

{
"connections": 100,
"uploads": 10,
"path": "/var/www/html/tdown",
"verify": true,
"dht": true,

}

& i got this error:
$ peerflix-server info - socket.io started
(node:16364) DeprecationWarning: process.EventEmitter is deprecated. Use
require('events') instead.
undefined:8
}
^

SyntaxError: Unexpected token } in JSON at position 156
at Object.parse (native)
at /usr/lib/node_modules/peerflix-server/server/store.js:93:22
at FSReqWrap.readFileAfterClose as oncomplete


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/asapach/peerflix-server/issues/63#issuecomment-237833397,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABrIyGzEhhaTbPWJ2_zLb8WoctsGQdpfks5qcyZ3gaJpZM4HkehK
.

<!-- gh-comment-id:237833642 --> @asapach commented on GitHub (Aug 5, 2016): You've got a trailing comma after "dht": true On Aug 5, 2016 3:03 PM, "yas9999" notifications@github.com wrote: > yeah i mean that RAM still used even if the torrent is downloaded 100%, i > had only 120 Mb free of RAM, so i can't add any new torrent. > i changed my config.json to: > > { > "connections": 100, > "uploads": 10, > "path": "/var/www/html/tdown", > "verify": true, > "dht": true, > > } > > & i got this error: > $ peerflix-server info - socket.io started > (node:16364) DeprecationWarning: process.EventEmitter is deprecated. Use > require('events') instead. > undefined:8 > } > ^ > > SyntaxError: Unexpected token } in JSON at position 156 > at Object.parse (native) > at /usr/lib/node_modules/peerflix-server/server/store.js:93:22 > at FSReqWrap.readFileAfterClose as oncomplete > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > https://github.com/asapach/peerflix-server/issues/63#issuecomment-237833397, > or mute the thread > https://github.com/notifications/unsubscribe-auth/ABrIyGzEhhaTbPWJ2_zLb8WoctsGQdpfks5qcyZ3gaJpZM4HkehK > .
Author
Owner

@yas9999 commented on GitHub (Aug 5, 2016):

Thank you so much bro, so this will solve my problem ? i mean peerflix will use my hard drive instead of RAM ?

<!-- gh-comment-id:237929630 --> @yas9999 commented on GitHub (Aug 5, 2016): Thank you so much bro, so this will solve my problem ? i mean peerflix will use my hard drive instead of RAM ?
Author
Owner

@asapach commented on GitHub (Aug 5, 2016):

It uses as much ram as it needs, but all the files are stored on the hard
drive.

On Aug 5, 2016 9:38 PM, "yas9999" notifications@github.com wrote:

Thank you so much bro, so this will solve my problem ? i mean peerflix
will use my hard drive instead of RAM ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/asapach/peerflix-server/issues/63#issuecomment-237929630,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABrIyCTAK7sjMJq2z7naz5JX4TAXqO5gks5qc4M9gaJpZM4HkehK
.

<!-- gh-comment-id:237930098 --> @asapach commented on GitHub (Aug 5, 2016): It uses as much ram as it needs, but all the files are stored on the hard drive. On Aug 5, 2016 9:38 PM, "yas9999" notifications@github.com wrote: > Thank you so much bro, so this will solve my problem ? i mean peerflix > will use my hard drive instead of RAM ? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > https://github.com/asapach/peerflix-server/issues/63#issuecomment-237929630, > or mute the thread > https://github.com/notifications/unsubscribe-auth/ABrIyCTAK7sjMJq2z7naz5JX4TAXqO5gks5qc4M9gaJpZM4HkehK > .
Author
Owner

@yas9999 commented on GitHub (Aug 5, 2016):

thanks 😄 so there is no solution to ignore RAM & stream by using HD or my server network like streaming files

<!-- gh-comment-id:237930699 --> @yas9999 commented on GitHub (Aug 5, 2016): thanks :smile: so there is no solution to ignore RAM & stream by using HD or my server network like streaming files
Author
Owner

@asapach commented on GitHub (Aug 5, 2016):

Torrents can be memory-hungry, especially when you stream them. The more ram you have the better.

<!-- gh-comment-id:237933752 --> @asapach commented on GitHub (Aug 5, 2016): Torrents can be memory-hungry, especially when you stream them. The more ram you have the better.
Author
Owner

@yas9999 commented on GitHub (Aug 5, 2016):

yeah, i don't know how much RAM i need because i like to share the use of peerflix with users i guess for 700-1000 maybe 32 GB of RAM will be perfect ....
i was using transmission but i thing this is the fast way to get files

Thank you so much bro

<!-- gh-comment-id:237989997 --> @yas9999 commented on GitHub (Aug 5, 2016): yeah, i don't know how much RAM i need because i like to share the use of peerflix with users i guess for 700-1000 maybe 32 GB of RAM will be perfect .... i was using transmission but i thing this is the fast way to get files Thank you so much bro
Author
Owner

@yas9999 commented on GitHub (Aug 6, 2016):

@asapach there is any possibility to control file size?

<!-- gh-comment-id:238017296 --> @yas9999 commented on GitHub (Aug 6, 2016): @asapach there is any possibility to control file size?
Author
Owner

@asapach commented on GitHub (Aug 6, 2016):

What do you mean? The file size is determined by the torrents you download.

6 авг. 2016 г. 1:37 PM пользователь "yas9999" notifications@github.com
написал:

@asapach https://github.com/asapach there is any possibility to control
file size?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/asapach/peerflix-server/issues/63#issuecomment-238017296,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABrIyIEXB-ZKtXwkJqCZdvzRVaBezJcyks5qdGPYgaJpZM4HkehK
.

<!-- gh-comment-id:238017468 --> @asapach commented on GitHub (Aug 6, 2016): What do you mean? The file size is determined by the torrents you download. 6 авг. 2016 г. 1:37 PM пользователь "yas9999" notifications@github.com написал: > @asapach https://github.com/asapach there is any possibility to control > file size? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > https://github.com/asapach/peerflix-server/issues/63#issuecomment-238017296, > or mute the thread > https://github.com/notifications/unsubscribe-auth/ABrIyIEXB-ZKtXwkJqCZdvzRVaBezJcyks5qdGPYgaJpZM4HkehK > .
Author
Owner

@yas9999 commented on GitHub (Aug 6, 2016):

for example : max file size allowed is 1000 MB, in case if the torrent is bigger than 1000 MB it won't be downloaded !
as there is no option to avoid RAM use i can limit users & get more RAM by time !
as the service will be free users will increase & i need to add more RAM, so limit users per file size will be my solution at this time

<!-- gh-comment-id:238022833 --> @yas9999 commented on GitHub (Aug 6, 2016): for example : max file size allowed is 1000 MB, in case if the torrent is bigger than 1000 MB it won't be downloaded ! as there is no option to avoid RAM use i can limit users & get more RAM by time ! as the service will be free users will increase & i need to add more RAM, so limit users per file size will be my solution at this time
Author
Owner

@Porco-Rosso commented on GitHub (Aug 6, 2016):

By default peerflix downloads torrents to disk (HDD/SDD). The RAM is only used during the torrenting & streaming process, and should easily support several hundred torrents with only a few GBs of RAM. I can't imagine RAM being your bottleneck until you are serving to 50+users

The only way the torrents are being saved to RAM is if you set up some sort of RAMDisk soultion such as https://www.jamescoyle.net/how-to/943-create-a-ram-disk-in-linux

<!-- gh-comment-id:238024289 --> @Porco-Rosso commented on GitHub (Aug 6, 2016): By default peerflix downloads torrents to disk (HDD/SDD). The RAM is only used during the torrenting & streaming process, and should easily support several hundred torrents with only a few GBs of RAM. I can't imagine RAM being your bottleneck until you are serving to 50+users The only way the torrents are being saved to RAM is if you set up some sort of RAMDisk soultion such as https://www.jamescoyle.net/how-to/943-create-a-ram-disk-in-linux
Author
Owner

@asapach commented on GitHub (Aug 6, 2016):

@yas9999, if you want this functionality, you will have to add it yourself. For example here you can inspect the total size of all the files in the torrent (file.length) and destroy the torrent if it exceeds your limit.

<!-- gh-comment-id:238025219 --> @asapach commented on GitHub (Aug 6, 2016): @yas9999, if you want this functionality, you will have to add it yourself. For example [here](https://github.com/asapach/peerflix-server/blob/master/server/engine.js#L29) you can inspect the total size of all the files in the torrent (`file.length`) and destroy the torrent if it exceeds your limit.
Author
Owner

@yas9999 commented on GitHub (Aug 6, 2016):

@Porco-Rosso yes you have right i'll serve more than 500 users :/
thank you @asapach i will try to add i guess this is the best solution for me at the moment 😄

regards,

<!-- gh-comment-id:238025837 --> @yas9999 commented on GitHub (Aug 6, 2016): @Porco-Rosso yes you have right i'll serve more than 500 users :/ thank you @asapach i will try to add i guess this is the best solution for me at the moment :smile: regards,
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#267
No description provided.