On Tue, 13 Jul 2010 08:29:00 +0200 "Heinz N. Gies" <he...@licenser.net> wrote:
> > On Jul 13, 2010, at 2:44 , Folcon wrote: > > > > > > > On Jul 13, 1:36 am, ngocdaothanh <ngocdaoth...@gmail.com> wrote: > >>> Are there any ways to restrict how many resources a user has access to? > >> > >> If you use Linux, you see /etc/security/limits.conf. > > > > That is useful and I will keep that in mind, however I was thinking of > > application users, so they would login to the clojure application and > > run scripts on it. Can they somehow be restricted? > > > > I will definitely consider running the app under a seperate user and > > putting limits on that user as a whole. > > Hi Falcon, > yes and no, you can limit CPU usage by limiting execution time. Limiting > memory usage of a specific code is hard at best and more goes towards the > impossible corner - sadly, I try to do this myself for clj-sandbox and fail > since about half a year :P. If you're on Linux, there's a sysctl you can use to cap the processes various memory usages. However, that's on a per-process basis, so if the user can fork, they can use more total memory than that. (Hmm - maybe there's a per-user limit as well...) Not sure how you get to sysctl's from the java world, though. If you're using Solaris, it has very good tools for limiting how much memory and/or CPU % a "project" can use, where projects can be pretty arbitrarily defined. If you're wanting to give people full access to clojure as part of the deal (a "try clojure online" type thing), then you can use solaris zones to create an environment that's isolated from the rest of your system and having a maximum percentage of CPU and memory available. <mike -- Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en