BookmarkSubscribeRSS Feed

Compute Tasks are The New Fast Execution Path for Stored Processes in SAS Viya

Started Tuesday by
Modified Tuesday by
Views 130

SAS Viya continues to evolve, addressing customer feedback about the performance of stored process execution. With the 2025.09 release, SAS Viya introduces a game-changing enhancement: a new, fast execution path powered by the “compute task” feature. This further lowers the barrier for customers looking to migrate and modernize their analytics workloads from SAS 9 to SAS Viya.

 

Let’s explore technical details, performance benchmarks, and practical considerations for adopting this enhancement, and what it means for architects and developers seeking maximum efficiency.

 

 

Why a New Execution Path?

 

Many customers rely on stored processes for reporting, charting, and running analysis on data of the most disparate kind. This includes complex use cases such as dynamic prompts and chained stored processes. With SAS 9, all these typically complete in seconds, yet the legacy execution model in SAS Viya sometimes results in performance issues, particularly due to session creation times. This gap not only frustrates some users but also blocked some organizations from migrating to SAS Viya.

 

The new compute task feature directly addresses these pain points, unlocking the performance users expect and enabling a smoother transition from SAS 9.

 

 

Introducing the Compute Task Feature

 

Tasks are programs that execute within a few seconds and are safe to interrupt or re-submit. The compute task feature, available in the 2025.09 release, is designed for these short-duration jobs. It offers:

 

  • Synchronous execution: Submit a program and receive its output in a single HTTP request.
  • Lightweight operation: A streamlined alternative to the traditional job execution service, optimized for speed over resilience.
  • Integration with Job Execution Web App: Switching to the new path is straightforward for existing users when scheduling, result persistence, and fault tolerant retries are not required.

 

 

How It Works

 

Compute Tasks leverage a new endpoint within the Compute API exposed by the Compute service: /compute/tasks.

 

As of SAS Viya 2025.09, you can work with compute tasks in two ways:

 

  • Access the API directly, calling the endpoint with a request containing the program to run and its arguments. With this method you can create a session, submit the program, wait for the program to finish, and retrieve the output in a single HTTP request. The compute API gives you a lot of freedom, and you can specify arguments that determine how you provide input data, how the compute service executes the task, what output to return, and more. You can read more about this in Xavier Bizoux’s article Using Compute Tasks in SAS Viya: Concepts, API and Examples
  • Execute jobs via the SAS Job Execution Web Application as a compute task. 

    01_ER_20251002_ComputeTasks._02.gif

    This method is especially useful for executing SAS Stored Processes that have been migrated to SAS Viya from SAS 9.4. Two key job definition parameters enable this new method:

     

    1. Compute Context: Ensure the compute task runs on a context with reusable compute servers.
    2. Execution Task Parameter: Set the new _executionTasks parameter to true in your job definition.

      02_ER_20251002_ComputeTasks_01.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.

 

 

A Graphical Comparison

03_ER_20251002_Compute-job-VS-task-Compute-Job.png

 

Above: submitting two compute jobs through the traditional path; notice how the client uses multiple asynchronous calls for each job, and a new compute server is started for each job.

 

Below: submitting two compute tasks through the new fast path; the client uses only one synchronous call per task, leveraging a pre-started compute server.

04_ER_20251002_Compute-job-VS-task-Compute-Task.png

 

Restrictions and Considerations

 

While the compute task feature is a major step forward, there are some important considerations:

 

  • Max Timeout: because the execution of a task involves a single synchronous HTTP request, the compute service enforces a timeout, configurable up to a maximum value of 30 seconds (the default is 5 seconds). If the timeout expires, the client receives a “504 Gateway Timeout” error. If you know that a job could take longer than 30 seconds, you can submit it using the existing asynchronous method.
  • Not the default (yet): by default, the Job Execution Web Application does not use the Compute task capability unless you explicitly set the _executionTasks parameter to True.
  • Program restrictions: the program you execute must be cancelable and restartable. A synchronous HTTP connection might drop mid-execution for multiple reasons, including network issues or pod termination. In these cases, SAS Viya does not automatically resume the task that was in flight, and you must resubmit it from the beginning.
  • Server requirements: compute tasks require pre-started, reusable server contexts. Otherwise, waiting for the backend server to start on-demand could require more time than what is permitted by the service timeout.

 

 

Preliminary Performance Benchmarks

 

Preliminary testing from an Azure environment (using a standard small machine) demonstrates the dramatic improvements:

 

  • Default job execution (legacy path): ~6.5 seconds for a simple “hello world” test.
  • Reusable compute context (legacy path): ~1.5 seconds.
  • Compute task endpoint: Under 500 milliseconds: comparable to SAS 9 performance

 

Note: Actual performance may vary depending on your environment. 

 

 

Roadmap: What’s Next?

 

The journey doesn’t end here. Upcoming enhancements might include:

 

  • Further reduction in session initialization time.
  • Feature parity with stored process server functions and macros.
  • Session state maintenance across requests.

 

Stay tuned for continued performance improvements and expanded capabilities!

 

Getting Started Links

Comprehensive documentation is available to help you get started.

 

 

Are you ready to unlock the full performance potential of your stored processes in SAS Viya? Try the new compute task feature and let us know your experience!

 

 

Find more articles from SAS Global Enablement and Learning here.

Contributors
Version history
Last update:
Tuesday
Updated by:

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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

Article Tags