AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  specifying hard cpu affinity for processes in AIX

    Posted Sun February 10, 2008 10:14 PM

    Originally posted by: SystemAdmin


    I am new to AIX. hopefully I am using the terminology correctly.

    I have a question related to setting the CPU affinity of a process.

    I am wondering (a) if it is possible, and (b) how to do it.

    some details. A project of mine has an LPAR running AIX 5.3 with 4 CPUs assigned to it. ("lparstat" as well as "topas -C"). During performance testing, I would like to limit the application server (WebSphere) to only 2 of the 4 CPUs on the LPAR.

    I would like to do this "limiting" as part of the script that starts the app server. Yes, I believe that the admin for the box could reconfigure the LPAR to only have access to 2 CPUs, but I am trying to avoid the involvement of the admin.

    Can something like this be done on AIX?

    This concept is something that is possible in Linux; here is an article I found elsewhere on the IBM site: Take charge of processor affinity: Knowing a little bit about how the Linux® 2.6 scheduler treats CPU affinity can help you design better userspace applications. Soft affinity means that processes do not frequently migrate between processors, whereas hard affinity means that processes run on processors you specify. This article describes current affinity mechanisms, explains why and how to use hard affinity, and provides sample code showing you how to use the available functionality. http://www.ibm.com/developerworks/linux/library/l-affinity.html

    thanks for your time.

    -markus


  • 2.  Re: specifying hard cpu affinity for processes in AIX

    Posted Sun February 10, 2008 11:55 PM

    Originally posted by: tony.evans


    http://www.ibm.com/developerworks/aix/library/au-processinfinity.html

    Note that this won't have the same effect as reducing the CPU count to 2, because leaving it at 4 means the other processes will have CPU cycles that wouldn't exist in a 2 CPU LPAR.

    Also, I have no experience at all of how processor affinity is handled on virtual CPU's if you're using p5's and shared processor pools.

    Message was edited by: tony.evans


  • 3.  Re: specifying hard cpu affinity for processes in AIX

    Posted Mon February 11, 2008 09:06 AM

    Originally posted by: phastjay


    If you want to restrict the amount of processing capacity available to WebSphere you can use Workload manager (WLM) to set a hard limit of 50% of the capacity available (in this case 50% of 4 processors). That would be the easiest and best way to solve that problem.

    There are alternative ways to approach limiting processor resource with WLM. For example, you can also use resource sets (RSET) to limit the WebSphere processes to 2 of the logical CPUs. The use of RSET to associate the process with logical processors can be less efficient if the logical processors associated with the RSET are in use by other processes at the instant that the WebSphere process wishes to use a processor so the WebSphere process would have to wait.

    There is also a way to assign a logical processor to a process exclusivily (Exclusive RSET) but that can drive even more inefficiency because in that case, only WebSphere could use those logical processors.

    WLM can be somewhat of a bear to set up, but if you are running on AIX 6, you can start the WebSphere in an Application WPAR with resource controls set to 50% of the available processing capacity and AIX will set up all the WLM stuff for you automatically.

    Remember that on System p/AIX hardware, the application processes only "see" logical processors. The actual physical processor that runs a particular process in an LPAR can and will in many cases, change every time the process is dispatched. So for System p/AIX, affinity is a system level concept of associating a physical processors used by a partition with the memory associated by the partition so that the processors and memory are both physically close to each other to reduce processor to memory latency as opposed to binding a process to a particular physical processor.

    Hope this helps,
    Jay


  • 4.  Re: specifying hard cpu affinity for processes in AIX

    Posted Wed March 05, 2008 01:10 PM

    Originally posted by: SystemAdmin


    That's easy: You use the "bindprocessor" command. The syntax is this:

    bindprocessor <pid> <cpuid>

    That's all there is to it.


  • 5.  Re: specifying hard cpu affinity for processes in AIX

    Posted Sun March 30, 2008 09:37 PM

    Originally posted by: SystemAdmin


    thank you for the information.