Projects in Solaris

When I was reading an interesting blog about prstat behavior, I read about projects in Solaris. After reading about projects, I came to know that they are mainly used for controlling resources used by process[es]. Suppose, if we want to control the CPU/disc/memory usages, then we create a project [using projadd, projmod] and in /etc/project, we have to modify resource control field. Then we can create/attach processes into this project [using newtask]. Once the process is created/attached in this project, all resource constraints will apply to that process. Suppose if the resource constraint name is process.max-file-descriptor and the value is 10, a process in that project can not have more that 10 file descriptors. Moreover, using prstat -J command, we can clearly see the resources used for projects. I felt this is a very good way to control resources used by specific processes, but I don’t know if the similar thing exists on other platforms like Linux. Some good links that I have referred are here & here.

About these ads

4 Comments

  1. kiran said,

    November 12, 2008 at 7:06 pm

    need the details about a solaris project to put in resume

  2. Diego said,

    June 17, 2009 at 8:47 pm

    # create project for mysql user
    projadd user.mysql
    # current max open file descriptors
    prctl -n process.max-file-descriptor $$
    # change it
    projmod -sK “process.max-file-descriptor=(basic,8192,deny)” user.mysql
    # current max shared memory
    prctl -n project.max-shm-memory $$
    # change it
    projmod -sK “project.max-shm-memory=(privileged,3221225472,deny)” user.mysql
    # view current project attribs
    projects -l user.mysql
    # or
    grep user.mysql /etc/project
    # view user’s current projects
    /usr/bin/projects
    It gives:
    default user.mysql

    How can I remove the user from default project?

  3. Luis Flores said,

    August 20, 2009 at 8:35 pm

    I know this posting is old, but just in case someone else has the same question: the problem here is that you never assigned the newly created project to any user. a project has been created, and that is it. a project by itself is meaningless unless a process/userID/username is assigned to it. at this point all you have it this:
    # projects -l user.mysql
    user.mysql
    projid : 100
    comment: “”
    users : (none)
    groups : (none)
    attribs: process.max-file-descriptor=(basic,8192,deny)
    project.max-shm-memory=(privileged,3221225472,deny)

    you see, there is not users or groups assigned to the projects. you need to add something to it like:
    projmod -U mysql user.mysql

    then you will see the following:

    # projects -l user.mysql
    user.mysql
    projid : 100
    comment: “”
    users : mysql
    groups : (none)
    attribs: process.max-file-descriptor=(basic,8192,deny)
    project.max-shm-memory=(privileged,3221225472,deny)

    and if you “su – myql” then you will see

    $ projects
    default user.mysql

    now mysql is has a project applied to it.
    hope this helps
    -Luis

  4. Vina said,

    September 7, 2012 at 3:44 pm

    thanks Luis..this is what i’ve been loooking for! :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: