[ic] howto do if file exists

Nicholas Cook interchange-users@icdevgroup.org
Sun Apr 20 00:33:00 2003


Steve wrote:
>>Of course, benchmarking would be required to *really* know how it compares
>>(if anyone wants to build the same system twice, just with different
>>filesystems).
> 
> Snip...
> 
> Aha, there is one. I think ReiserFS is a default option for Linux
> "mkfs", so that would be viable.
> 
> Still in all, it might be nice to have some management for images in IC.
> I was thinking of:
> 
>     1. Images table in database.
> 
>     2. The image tag checks for file, if not gives URL to IC-based page
>        that pulls image from table and writes to file system.
> 
>     3. Optional entry to map image to hashed directory.
> 
>     4. External check script (just DBI) which removes directory and
>        rewrites all images in hashed directories based on some algorithm
>        -- and saves results appropriately in products table.
> 
>     5. The reverse script which pulls in an image directory to the
>        table; must have "items" and "thumb" directory to read which are
>        product images and which are regular images.
> 
>     6. Auto thumbnail generation.
> 
>     7. Change image upload to go to image table instead of to file
>        system.
> 
> It would probably take me about a day to get it mostly done; but it
> would take 4 or 5 more days to document and refine and test. It would be
> too much of a support hassle for the list with the amount of time I can
> afford to spend on it, so I probably shouldn't do it. 8-}
> 
> --
> Mike Heins
> Perusion -- Expert Interchange Consulting    http://www.perusion.com/
> phone +1.513.523.7621      <mike@perusion.com>
> <<<<<<<<<<<<<<
> 
> This sounds like it might be a good idea if it is fairly simple to
> implement.
> We currently have about 2000 items in our database, and the images are in
> the standard locations as defined in the foundation example. We will
> probably have about 5-10 thousand image files in each directory for image,
> thumb, and large when we get done adding everything. Performance is ok now,
> but I guess it will degrade over time.
> 
> -Steve
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users
> 
> 

I'm currently at a little over 7000 images.  This is on a lightly loaded 
system so at this point I'm not experiencing any performance issues.  I 
went with Mike's suggestion of using apache to handle whether or not the 
image is present.

With the reiserfs solution, another piece that would increase 
performance (it helps with ext3 as well) is to mount the file system 
with noatime.

Mike, may I make the suggestion that if you do spend the time to develop 
what you laid out below, that you include a field for sound files as 
well.  Just a thought.

Nicholas Cook