BookmarkSubscribeRSS Feed

CAS is Elastic! Part 2

Started ‎11-21-2024 by
Modified ‎11-21-2024 by
Views 701

In Part 1, we introduced the concept of elasticity as it applies to CAS. Now, let's explore the setup and demonstrate how table rebalancing operates.

 

 

Setup for CAS Table Rebalancing

 

Enabling table rebalancing is only necessary when adding more workers or when a failed worker node is restarted.

 

For a detailed setup guide, Gilles provides step-by-step instructions in his post.

 

To activate table rebalancing, set the following environment variables to "true" in CAS:

 

  • CAS_GLOBAL_TABLE_AUTO_BALANCE for permanent CAS tables
  • SESSION_TABLE_AUTO_BALANCE for session CAS tables

 

01_nir_post_99_01_cas_table_rebalancing_options.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

Indeed, you may choose to apply rebalancing only to global tables, as session tables may not always need it.

 

These variables unlock the rebalancing feature, but additional configuration is required to specify which tables should be rebalanced.

 

Now, SAS Administrators or Programmers must designate which tables are eligible for rebalancing when more workers are added. This is controlled by the tableRedistUpPolicy option, which has two settings:

 

  • NOREDIST: Prevents redistribution of table data when the number of worker pods increases.
  • REBALANCE: Enables rebalancing of table data when the number of worker pods increases.

 

You can set tableRedistUpPolicy at various levels, depending on whether you need a global or table-specific configuration. Here’s the order of precedence:

 

Order of precedence Option Scope Example
1 tableRedistUpPolicy CAS action casout option Table proc cas ;
   simple.freq /
      table={caslib="DM", name="prdsale"},
      inputs={"country"},
      casOut={caslib="DM", name="country_freq", tableRedistUpPolicy="REBALANCE"} ;
quit ;
2 tableRedistUpPolicy CASLIB option CASLIB caslib DM datasource=(srctype="path") path="/gelcontent/" tableRedistUpPolicy=REBALANCE ;
3 sessionTableRedistUpPolicy CAS session option Session table in a CAS session cas mysession sessopts=(sessionTableRedistUpPolicy=rebalance) ;
4 cas.TABLEREDISTUPPOLICY CAS option CAS server cas.TABLEREDISTUPPOLICY = ‘REBALANCE’

 

 

How Does CAS Table Rebalancing Work?

 

Let’s explore how CAS table rebalancing affects each of our four scenarios. Watch the videos below to see rebalancing in action.

 

  1. Adding Workers for Peak Activity

 

When a SAS Administrator adds one or more new CAS workers to handle a surge in activity.

 

 

 

  1. Removing Workers to Return to Normal

 

When a SAS Administrator removes one or more CAS workers to scale back to normal resource levels.

 

 

 

  1. Handling Node Failure with Automatic Restart

 

When a CAS worker fails (node failure), and Kubernetes automatically restarts a new one to maintain the right number of workers.

 

 

 

  1. Handling Node Failure Without Restart

 

When a CAS worker fails, but Kubernetes is unable to restart a replacement within 60 seconds, triggering rebalancing on the remaining nodes.

 

 

 

That's it for this one. In the final part, we will cover additional considerations regarding CAS table rebalancing.

 

Thanks for reading!

 

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎11-21-2024 02:19 PM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started