LatticaAI Documentation
  • Welcome to LatticaAI
  • Conceptual Guide
  • Architecture Overview
    • Management Client
    • Query Client
  • Platform Workflows
    • Account Management
    • Model Management
    • User Access Management
    • Query Submission
    • Credit Management
    • Worker Management
  • How-To Guides
    • Client Installation
      • How-To: Install Management Client
      • How-To: Install Query Client
    • Model Lifecycle
      • How-To: Deploy AI model
      • How-To: Modify AI Model Settings
    • Access Control
      • How-To: Create User Access Token
      • How-To: Modify User Access Token Setting
      • How-To: Remove Token's Assignment
      • How-To: Assign Token to Model
      • How-To: See List of Tokens
    • Resource Management
      • How-To: Start Worker
      • How-To: Stop Worker
      • How-To: Monitor Worker Performance
    • Secure Query Processing
      • How To: Upload Evaluation Key
      • How-To: Encrypt Input Message
      • How To: Execute Query
      • How-To: Decrypt Output Data
      • How-To: Encrypt, Execute, and Decrypt in One Step
    • Account and Finance Operations
      • How-To: View Payment Transaction History
      • How-To: Update Account Information
      • How-To: View Credit Balance and Add Credit to Your Account
      • How-To: Monitor Balance and Usage
  • Demo Tutorials
    • Image Sharpening with LatticaAI Demo Tutorial
    • Sentiment Analysis with LatticaAI Demo Tutorial
    • Health Analysis with LatticaAI Demo Tutorial
    • Digit Recognition with LatticaAI Demo Tutorial
    • Zooming Into Each Step of Demo Run with LatticaAI flow
Powered by GitBook
On this page

Was this helpful?

  1. How-To Guides
  2. Resource Management

How-To: Monitor Worker Performance

PreviousHow-To: Stop WorkerNextSecure Query Processing

Last updated 3 months ago

Was this helpful?

Monitoring worker performance helps ensure optimal query processing and identifies when additional workers may be needed to maintain performance. This guide explains how to monitor worker performance for a specific model using the web console.

Log in to the web console to access the Main Page, where modules for each of your models are displayed, and identify the module corresponding to the model for which you want to monitor a worker's performance.

The model's performance metrics are displayed below its name:

  1. Current Load: Shows the average query processing time in the last 5 minutes.

  2. Average Load: Indicates the model's average query processing time over the past month.

  3. Active Workers: Lists the number of workers currently running for the model.

import lattica_common.auth_local_state as auth
import lattica_common.app_api as agent_app

# Notice your account token expires every 30 days and it's up to you to renew it
auth.set_session_token("your_account_token_you_got_in_your_email")

# Retrieve all active workers for a specific model
active_workers = agent_app.worker.get_active_workers("model_id")

# Iterate through each active worker and get detailed worker information
for active_worker in active_workers:
    # Retrieve worker information using the workerSessionId
    worker_session_id = active_worker.workerSessionId

    # In case of failur this function throws
    worker_info = agent_app.worker.get_worker_info(worker_session_id)
    
    # Print or process the worker information as needed
    print(f"Worker Session ID: {worker_session_id}")
    print(f"Worker Info: {worker_info}\n")

Compare Current Load and Average Load

If the Current Load is significantly higher than the Average Load, it indicates increased query traffic or reduced performance. In this case, consider starting additional workers to distribute the load.


Worker Performance