EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB484614: How to set the CPU affinity for MicroStrategy Web JSP in Linux


Pedro Salazar Garza

Senior Manager, Cloud Support • MicroStrategy


This article describes how to verify the current CPU affinity and how to set the CPU Affinity for MicroStrategy Web JSP in Linux.

CPU Affinity


Depending on the number of CPU-based licenses you purchase, you can have multiple processors (CPUs) running the Intelligence Server and Strategy Web. The ability to deploy the Intelligence Server or Strategy Web on specific, selected CPUs (a subset of the total number of physical CPUs) on a given machine is called CPU affinity (or processor affinity). As part of the installation process, you must provide the number of processors to be used by the Intelligence Server or Strategy Web on that machine.
For more information on how to apply CPU affinity to the Strategy Intelligence Server or Strategy Web ASP, refer to this documentation.
 

CPU Affinity for Strategy Web JSP


If you have CPU-based licenses for Strategy Web JSP, you will need to apply CPU affinity to match your CPUs and licenses by choosing which processors the web application server hosting Strategy Web uses on a given machine.
Strategy does not provide the mechanism to set the CPU affinity for Strategy Web JSP like it does for the Strategy Intelligence Server, as Strategy Web JSP is deployed on third party web application servers. It is the responsibility of the license-user to comply with their license restrictions.
Note: Failure to apply the CPU affinity to the Strategy Web JSP machine will result in being out of compliance with the Strategy License.
Strategy provides the following steps on how to apply CPU affinity as a sample guide. The instructions may vary depending on the operating system and on the application server’s brand, version, and specific configuration.

Set the CPU Affinity 

Verify if CPU affinity needs to be set


Refer to the following steps to set the CPU affinity for a CentOS Linux 7.8 machine using Redhat JBoss 7.2.0.
Before applying the CPU affinity, we’ll need to verify if there is any affinity set to the process already.

  • Strategy recommends running the application server as a service and not as an application. If it is already running as a service, skip to Step 2. Otherwise, create a
    *.service 
    file such as
    jbossEap720.service
    under
    /etc/systemd/system/
    with the content below:
    [Unit]	Description=JBoss EAP Service	After=syslog.target network.target 		[Service]	Environment=JBOSS_USER=root	Environment=JBOSS_HOME=/appSrv/EAP-7.2.0	Environment=JBOSS_CONSOLE_LOG=/appSrv/EAP-7.2.0/standalone/log/server.log Environment=RUN_CONF=/appSrv/EAP-7.2.0/bin/init.d/jboss-eap.conf	ExecStart=/appSrv/EAP-7.2.0/bin/init.d/jboss-eap-rhel.sh start	ExecStop=/appSrv/EAP-7.2.0/bin/init.d/jboss-eap-rhel.sh stop	Type = forking		[Install]	WantedBy=multi-user.target

ka04W000000WJIUQA4_0EM4W000001J3LB.jpeg
  • Note: The content of the file above is only a sample and may need to be changed depending on the environment's specific details.
  • You need to find the PID for your web application server. In the case of JBoss, here is documentation on how to find it from Redhat’s website.
    The documentation above recommends running the following: 
    
    $ pgrep -f jboss-modules.jar
    

ka04W000000WJIUQA4_0EM4W000001J3Je.jpeg
  • From the image above, it is easy to see the PID for JBoss is 23872.
    Another way to find the PID is to run:
    
    ps -aux
    

    And then search for the process tied to the web application server, as shown below.
ka04W000000WJIUQA4_0EM4W000001J3L6.jpeg
  • From the image above, we can confirm that the PID for JBoss is 23872.
  • Verify the current CPU affinity on the web application server PID. Refer to this documentation to learn how to verify the CPU affinity.
    The documentation above recommends running the following:
    
    tasket -pc PID
    

ka04W000000WJIUQA4_0EM4W000001J3K3.jpeg
  • Because the CPU affinity is currently set to 0-7, which is the maximum number CPUs in this machine, this process does not have CPU affinity set yet.

Apply the CPU affinity


Now that you have confirmed you need to apply CPU affinity, refer to the following steps. 
Here are some resources for setting the CPU affinity: 

  • Red Hat Customer Portal: Realtime-Specific Tuning
  • Linux Manual Page
  • Following best practices for Linux, make a backup of the
    *.service
    file in the
    /etc/systemd/system/
    directory that runs the application server as a service.
  • Stop the web application server service.
  • Modify the
    *.service
    file to add the line:
    
    CPUAffinity=x,y,z
    

    Where
    x,y,z
    are the CPU numbers of the CPUs that will be used by this service. In the case below, the CPU affinity is being set to 1 because the license key used only allows 1 CPU.
ka04W000000WJIUQA4_0EM4W000001J3LG.jpeg
  • Another example with more CPUs look like:
ka04W000000WJIUQA4_0EM4W000001J3LL.jpeg
  • For the changes to take effect, run the following command:
    
    Systemctl daemon-reload
    

ka04W000000WJIUQA4_0EM4W000001J3Kh.jpeg
  • Start the web application server service and confirm the CPU affinity has been applied correctly.
    To do this, repeat Steps 2 and 3 from the Verify if CPU affinity needs to be set section above. 


If the process shows that it is using the selected CPUs as per the CPU Affinity, you are done.

Third Party Software Installation


WARNING:
The third-party product(s) discussed in this technical note is manufactured by vendors independent of Strategy. Strategy makes no warranty, express, implied or otherwise, regarding this product, including its performance or reliability.


Comment

0 comments

Details

Knowledge Article

Published:

October 8, 2020

Last Updated:

October 8, 2020