<cfif DirectoryExists("/s3bucketmapping/foldername/")>
The question is what you are doing with the files. An approach would be rather than proactively checking the file exists in this way either have a separate cache of existing assets which you update asynchronously via a scheduled task or something. Or code for failure if you believe it exists try and use it, catch error and deal with if it doesn't. Understanding the logic or how often you use the files or the likelihood of file not being there and circumstances is important. But the key thing you've noticed is s3 is exposed in a local resource way but you need to treat it as if interacting with a slow remote resource.
Thanks
A
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/09980066-53e5-45c3-8b1c-09dcc881b4e6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
That won't help because there are no such thing as directories it's because it has to do a file scan of the whole bucket directories are just faked paths. You can't change the performance characteristics of s3 you can just code around it.
Thsnks
Alex
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/CAGHrs%3D9trna8LpGLDrrYbNQ30jf-UC5j%2BGoFY-z0AW6Bayxwtw%40mail.gmail.com.
Hi I've never used the railo resource mapping or equivalent in ACF I'd try http://amazons3.riaforge.org/
And see if you get what you expect then I guess go from there if you think it's a bug, it's worth raising it with Micha
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/72667495-34ad-4f54-9ac6-856296f3e662%40googlegroups.com.
I'm aware of that but if you are having problems with the built in wrapper working out whether it behaves the same way with the rest API is a good plan and with this you can see what's going on or you can debug java source for the wrapper
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/cd18c9f6-ba32-421f-a7d0-d4bee02cd080%40googlegroups.com.
I tried directoryExists() function on two C3.large AWS EC2 instances. Both fresh identical servers.
Railo took closer to 20k tick counts to return and Adobe
ColdFusion only took less than 100 every time.
Tested the same against different Railo servers outside AWS and they were all
far too slow.
1. My “folders” are quite large. I did not test with empty buckets. Also as
Andrew mentioned before if this happens on big buckets, is it fair to assume
Railo is downloading the entire inventory on every single Directory call? If
that is the case, it is quite DANGEROUS and this can rack up the S3 bill.
2. With ACFM, I can write files into new S3 “folders” directly. In other words, if the destination does not exist when we copy a file, it creates that path. Railo other hand throw destination directory does not exists error. I do not know exactly how many requests ACFM made to S3 when writing a file and creating a directory at the same time. It is generally better to minimize number of calls to S3, since every call costs money. In my case, 100 threads copy 100 files into S3 and into different folders. With Railo I had to add “if not directoryExists(), then create directory” into my code when run with Railo.
3. We can move into AWS Java SDK, but having this function inside CFM make things very easy. For example, we can zip a file into S3 in a single step.
Thanks
- Sam