3 Answers
- Newest
- Most votes
- Most comments
0
import boto3
import json
from datetime import datetime
def jobProperties():
global client, job
# Create a Glue client
client = boto3.client('glue', region_name='eu-west-1')
# Get the current job configuration
response = client.get_job(JobName='my-job')
job = response['Job']
# Function to convert datetime objects to strings
def datetime_converter(o):
if isinstance(o, datetime):
return o.isoformat()
# Serialize the job configuration to JSON
job_json = json.dumps(job, indent=2, default=datetime_converter)
print(job_json)
jobProperties()
def updatejob() -> None:
# Define the updated job parameters
updated_job = {
'Description': 'A job that filters geocode querys per country metadata matches', # Change the description
'GlueVersion': '4.0', # Change the Glue version to '4.0'
'Command': job['Command'], # Ensure the Command property is included
'Role': job['Role'], # Include the IAM role
'Timeout': 480, # Set the desired timeout in minutes
'NumberOfWorkers': 20, # change number of workers
'WorkerType': 'G.1X', # change worker type
'MaxRetries': 0, # change max retries
'ExecutionClass': 'FLEX', # Include the ExecutionClass
"ExecutionProperty": {"MaxConcurrentRuns": 4}
}
# Unknown parameter in JobUpdate: "MaxConcurrentRuns",
# must be one of:
# Description,
# LogUri,
# Role,
# ExecutionProperty,
# Command,
# DefaultArguments,
# NonOverridableArguments,
# Connections,
# MaxRetries,
# AllocatedCapacity,
# Timeout,
# MaxCapacity,
# WorkerType,
# NumberOfWorkers,
# SecurityConfiguration,
# NotificationProperty,
# GlueVersion,
# CodeGenConfigurationNodes,
# ExecutionClass,
# SourceControlDetails
# Update the job with the new timeout
response = client.update_job(
JobName='my-job',
JobUpdate=updated_job
)
print(response)
jobProperties()
updatejob()
answered 2 years ago
0
Your Magic looks good and it will allow you to run 4 instance of the job concurrently.
- Check the concurrency is configured from job property with below command, and the output with 4 MaxConcurrentRuns : aws glue get-job --job-name "country-job" --profile glue-eu
"ExecutionProperty": {
"MaxConcurrentRuns": 4
}
- Check the run instance not crossing 4 from "Runs" or Glue Monitoring console.
- Finally, remember after the Glue job completes (SUCCEEDED or FAILED), it needs few seconds (around 5-10 seconds) to completely cleanup resources, until then it considered running. This is because the job metering stopped for customer, but it can still conflict with concurrency. So either slow down on the request for new run or have little higher concurrency count.
answered 3 years ago
0
Hi Jorge Vidinha! Did you figure this out by any chance? I am running into the same issue.
answered 2 years ago
Relevant content
asked 3 years ago
asked 8 years ago
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago

Thanks , I did run the get-job command and im seeing in fact that the the value is in fact = 1 "ExecutionProperty": { "MaxConcurrentRuns": 1 },
How can this be if on my Jupyter magic && configure I have it like = 4 ( "max_concurrent_runs": 4 ) , how do you set this on your jupyter notebook runs ?
%%configure { "region": "eu-west-1", "idle_timeout": "480", "glue_version": "4.0", "number_of_workers": 10, "execution_class": "FLEX", "iam_role": "arn:aws:iam::ABC:role/AWSGlueServiceRole-searchlogs-s3", # "profile": "glue-profile", "session_id_prefix": "ABC", "worker_type": "G.1X", "max_concurrent_runs": 4 }