You are not logged in.

#1 2010-07-21 23:42:14

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Best way to share 40,000+ files?

Hi all,

I have approximately 40,000 files (documents, photos, videos and audio) and need to share them on my local network.  I have tried nfs and samba but I am having serious delays from connecting to displaying the files.

Do you have any ideas about the best way to serve these file and be able to browse these files?

I am thinking about putting them on an intranet server, with gallery pages for image/photos.

Do you think this is a good idea?

TOH wants 'instant access to the photos'.

Any ideas or comments would be greatly appreciated.

Diesel1.


Registered GNU/Linux user #140607.

Offline

#2 2010-07-22 00:40:03

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Best way to share 40,000+ files?

How many files in a single sub directory? At some point, regardless of the sharing method, the internal readdir() calls get to be substantial. You can reduce the latency through reorganization.

Offline

#3 2010-07-22 01:50:12

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Best way to share 40,000+ files?

diesel1 wrote:

I have approximately 40,000 files (documents, photos, videos and audio) and need to share them on my local network.

That shouldn't be a problem... I have over 120,000 files on one server shared.

As falconindy mentioned, they're not all in one directory are they? neutral

Last edited by fukawi2 (2010-07-22 01:50:24)

Offline

#4 2010-07-22 03:53:40

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: Best way to share 40,000+ files?

40K files in one directory, sounds like a real nightmare.... Reorganization is almost mandatory in such a case.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#5 2010-07-22 03:54:43

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: Best way to share 40,000+ files?

#!/bin/bash

find . -maxdepth 1 -type f | while read file; do
  upper_name=`basename "$file" | tr '[:lower:]' '[:upper:]'`
  new_path="`dirname "$file"`/${upper_name:0:1}"
  mkdir -p "$new_path"
  mv "$file" "$new_path"
done

Offline

#6 2010-07-22 04:02:47

deej
Member
Registered: 2008-02-08
Posts: 395

Re: Best way to share 40,000+ files?

Wintervenom wrote:
#!/bin/bash

find . -maxdepth 1 -type f | while read file; do
  upper_name=`basename "$file" | tr '[:lower:]' '[:upper:]'`
  new_path="`dirname "$file"`/${upper_name:0:1}"
  mkdir -p "$new_path"
  mv "$file" "$new_path"
done

Brilliant wink

Deej

Offline

#7 2010-07-22 06:24:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Best way to share 40,000+ files?

Or....

#!/bin/bash

find . -maxdepth 1 -type f | while read file; do
  ext=`echo ${file#*.} | tr '[:lower:]' '[:upper:]'`
  new_path="`dirname "$file"`/${ext}"
  mkdir -p "$new_path"
  mv "$file" "$new_path"
done

tongue

Last edited by fukawi2 (2010-07-22 06:25:10)

Offline

#8 2010-07-22 07:03:34

deej
Member
Registered: 2008-02-08
Posts: 395

Re: Best way to share 40,000+ files?

fukawi2 wrote:

Or....

#!/bin/bash

find . -maxdepth 1 -type f | while read file; do
  ext=`echo ${file#*.} | tr '[:lower:]' '[:upper:]'`
  new_path="`dirname "$file"`/${ext}"
  mkdir -p "$new_path"
  mv "$file" "$new_path"
done

tongue

Ah, dare I say - even better !

To save others the studying / testing, this script creates folders named after the file and puts the file within it's own folder, whilst Wintervenoms' creates folders based on
the first character of the file and puts all files beginning with that character within.

I smell a contest looming...

Deej

Last edited by deej (2010-07-22 07:04:42)

Offline

#9 2010-07-22 08:34:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

> I am thinking about putting them on an intranet server, with gallery pages for image/photos.
How many people are expected to access it - avg & tops?

Offline

#10 2010-07-22 09:48:56

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

Hi all,

The most files in a single directory is approximately 500 and definitely not more than 1000.

The maximum number of users at any one time would be 2or 3 but usually just the wife.

Should I use a CMS or just point apache at the files, or should I try again with nfs or samba?

Diesel1.


Registered GNU/Linux user #140607.

Offline

#11 2010-07-22 09:57:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

How ofter would the files change:, the dir structure / filenames, how many GB / per day new data?
I'm _really_ not into networking but Apache sounds a bit heavyweight - aren't there any simple fileservers?

Offline

#12 2010-07-22 09:59:43

ProgDan
Member
From: Prague, Czech Republic
Registered: 2007-10-04
Posts: 441
Website

Re: Best way to share 40,000+ files?

What about simple anonymous FTP server with access restricted only to local network?

Offline

#13 2010-07-22 10:00:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

ProgDan wrote:

What about simple anonymous FTP server with access restricted only to local network?

Does it support thumbnails of photos / videos?

Offline

#14 2010-07-22 10:09:47

ProgDan
Member
From: Prague, Czech Republic
Registered: 2007-10-04
Posts: 441
Website

Re: Best way to share 40,000+ files?

karol wrote:
ProgDan wrote:

What about simple anonymous FTP server with access restricted only to local network?

Does it support thumbnails of photos / videos?

That depends on the client. By default, FTP does not provide any feature like that. But for example Dolphin is capable of creating and displaying thumbnails for FTP images: it downloads the file, creates thumbnail and displays it (maybe it's not Dolphin's feature but KIO's feature). I'm not 100% sure, but I think that it even stores the thumbs in local cache.

EDIT: videos are not supported I think, it would be quite silly to download hundreds of MB of video just to cut off a simple frame and then throw it all away smile

Last edited by ProgDan (2010-07-22 10:10:51)

Offline

#15 2010-07-22 10:15:11

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

Hi all,

The files do not change very often but some editing and copying does take place.

Sometimes I add a few MB and sometimes I might add 20-30GB but that would usually be 10-15 videos.

Diesel1.


Registered GNU/Linux user #140607.

Offline

#16 2010-07-22 10:21:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

> TOH wants 'instant access to the photos'.
How big is your photo collection?

Videos are huge, but maybe every user can have his / her own copy locally?

Offline

#17 2010-07-22 10:38:31

whacath
Member
Registered: 2009-05-26
Posts: 283

Re: Best way to share 40,000+ files?

what about sshfs?

Offline

#18 2010-07-22 10:55:07

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

karol wrote:

> TOH wants 'instant access to the photos'.
How big is your photo collection?

Videos are huge, but maybe every user can have his / her own copy locally?

The collection is photos and videos in folders by category and date, there are 20,000 files taking 200GB.

I would rather not duplicate the collection (other than for backups).

Diesel1.


Registered GNU/Linux user #140607.

Offline

#19 2010-07-22 11:03:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

Would it be possible to duplicate just the photos?

Offline

#20 2010-07-22 11:57:21

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

karol wrote:

Would it be possible to duplicate just the photos?

I really do not want to duplicate any files.  I have the original content and if any user wishes to edit/modify photos they copy them locally.  I don't want multiple versions of files on multiple systems.

Diesel1.


Registered GNU/Linux user #140607.

Offline

#21 2010-07-22 12:24:18

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Best way to share 40,000+ files?

It might be worth looking at the bottlenecks, hard drive speed, network card, filesystem, etc. as 500 files in a folder shouldn't be too slow, I'd have thought. neutral

I have some image folders on my server with approaching that many and there's no obvious delay using samba (for me or for the missus's xp netbook). I put them all up on flickr too (additional bonus of off-site back-up), which used to be her access to them, but the local access is far quicker - as you'd expect.

There is a pause sometimes in downloading a 5+mb image (or multiple) when moving/viewing/editing etc. but that's probably wireless speeds as much as anything as with moving at least there's 10+mb being shifted.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#22 2010-07-22 21:10:48

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

skanky wrote:

It might be worth looking at the bottlenecks, hard drive speed, network card, filesystem, etc. as 500 files in a folder shouldn't be too slow, I'd have thought. neutral

I have some image folders on my server with approaching that many and there's no obvious delay using samba (for me or for the missus's xp netbook). I put them all up on flickr too (additional bonus of off-site back-up), which used to be her access to them, but the local access is far quicker - as you'd expect.

There is a pause sometimes in downloading a 5+mb image (or multiple) when moving/viewing/editing etc. but that's probably wireless speeds as much as anything as with moving at least there's 10+mb being shifted.

Hey, nice to hear from another Yorkshire Arch user!

I used to have no problems with nfs and samba but in the last year things seem to be so slow as to be unusable.  I think you are probably right about wireless speeds and also I have been using lots of cpu time with folding clients on the file sharing system.  also my photo files are now 5-7MB (Canon 500D camera) where before they were around 1-2MB.  Maybe I should set up a dedicated nfs/samba file server.

Diesel1.


Registered GNU/Linux user #140607.

Offline

#23 2010-07-22 21:13:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Best way to share 40,000+ files?

> I have been using lots of cpu time with folding clients on the file sharing system.  also my photo files are now 5-7MB (Canon 500D camera)
I think I can help you with the latter problem: send me the camera and go back to the 1-2 MB files :-)

Offline

#24 2010-07-22 21:16:42

diesel1
Arch Linux f@h Team Member
From: Leeds, UK.
Registered: 2007-07-19
Posts: 267

Re: Best way to share 40,000+ files?

karol wrote:

> I have been using lots of cpu time with folding clients on the file sharing system.  also my photo files are now 5-7MB (Canon 500D camera)
I think I can help you with the latter problem: send me the camera and go back to the 1-2 MB files :-)

That sounds like a really good idea, send me your full contact details and I will forward it to you without delay! wink

Last edited by diesel1 (2010-07-22 21:16:58)


Registered GNU/Linux user #140607.

Offline

#25 2010-07-23 08:25:58

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: Best way to share 40,000+ files?

Hey, nice to hear from another Yorkshire Arch user!

I hope we're not the only two. wink

Maybe I should set up a dedicated nfs/samba file server.

Yes, I should have said that mine is dedicated - it's a (not especially old) laptop with a fried video card. I wired it to the router, so only the client sides are wireless. Any flickr uploading is initiated via ssh from the server, and at some point within the rest of my lifetime I'll probably set-up an abs and/or pacman cache etc. etc. on it.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB