scheduling

How “real-time” are the FIFO/RR schedulers on non-RT Linux kernel?

一世执手 提交于 2021-02-20 03:44:55
问题 Say on a non-RT Linux kernel (4.14, Angstrom distro, running on iMX6) I have a program that receives UDP packets (< 1400 bytes) that come in at a very steady data rate. Basically, the essence of the program is: while (true) { recv( sockFd, ... ); update_loop_interval_histogram(); // O(1) } To minimize the maximally occuring delay time (loop intervals), I started my process with: chrt --fifo 99 ./programName setting the scheduler to a "real-time" mode SCHED_FIFO with highest priority. the CPU

cron-like recurring task scheduler design

泄露秘密 提交于 2021-02-17 22:12:24
问题 Say you want to schedule recurring tasks, such as: Send email every wednesday at 10am Create summary on the first day of every month And you want to do this for a reasonable number of users in a web app - ie. 100k users each user can decide what they want scheduled when. And you want to ensure that the scheduled items run, even if they were missed originally - eg. for some reason the email didn't get sent on wednesday at 10am, it should get sent out at the next checking interval, say

Spring boot Webservice / Microservices and scheduling

≯℡__Kan透↙ 提交于 2021-02-11 15:13:19
问题 I am having a spring boot application which exposes REST APIs and also am planning to add a spring boot scheduled task. The purpose of task is to pick up some pending 'reservations' from data store which is momgodb and process it. Now the question is when multiple instances of service running, there is high probability all the nodes will pick up same 'reservation records'. I was looking at mongodb lock for this and was checking updateAndModidy / transactions (in 4.x) of mongodb. Also

Spring boot Webservice / Microservices and scheduling

耗尽温柔 提交于 2021-02-11 15:11:41
问题 I am having a spring boot application which exposes REST APIs and also am planning to add a spring boot scheduled task. The purpose of task is to pick up some pending 'reservations' from data store which is momgodb and process it. Now the question is when multiple instances of service running, there is high probability all the nodes will pick up same 'reservation records'. I was looking at mongodb lock for this and was checking updateAndModidy / transactions (in 4.x) of mongodb. Also

Schedule Python Script in Bash?

时间秒杀一切 提交于 2021-02-10 05:37:54
问题 I am new to scheduling python scripts and need to start a script so it can run for a day or two. I am not allowed to use cron in my environment so am using this bash script. What is a simple test I can do to make sure the python file runs? How would I know that my file ran? And also, if it throws an error, how can I make sure I am notified? Any help would be appreciated. #!/usr/bin/bash while true do DATE="$(date +'%d')" MONTH="$(date +'%m')" YEAR="$(date +'%Y')" HOUR="$(date +'%H')" MINUTE="

Understanding the Shortest Job First Algorithm (Non-preemptive)

。_饼干妹妹 提交于 2021-02-08 11:52:11
问题 The shortest job first algorithm is shown in the following image: If it is shortest job first/shortest process next, shouldn't the order be: P1 → P5 → P3 → P4 → P2 ? Since that's the order of lowest to highest service times. Why does process 2 come second? I know if we use burst times instead, that would be the order, but I have no idea what the differences between service time and burst times are. Any help would be much appreciated explaining that graphic. 回答1: The image in the question

Optimal shift scheduling algorithm

China☆狼群 提交于 2021-02-07 02:50:55
问题 I have been trying for some time solve a scheduling problem for a pool that I used to work at. This problem is as follows... There are X many lifeguards that work at the pool, and each has a specific number of hours they would like to work. We hope to keep the average number of hours away from each lifeguards desired number of hours as low as possible, and as fair as possible for all. Each lifeguard is also a college student, and thus will have a different schedule of availability. Each week

get online data every hour in R

♀尐吖头ヾ 提交于 2021-02-06 11:32:07
问题 I would like to get the Observatory data every hour they update the forecast. My one time data extract code is following. library(RCurl) web <- getURL("http://www.hko.gov.hk/contente.htm") web <- unlist(strsplit(web, "\r\n")) head(web) temp <- unlist(strsplit(web[1245], "</span>")) MINtemp <- vector() MAXtemp <- vector() for (i in 1:9){ mintemp <- substr(temp[2*i-1], nchar(temp[2*i-1])-1, nchar(temp[2*i-1])) mintemp <- as.numeric(mintemp) MINtemp <- append(MINtemp, mintemp) maxtemp <- substr

Automate a weekly background function in WordPress

蹲街弑〆低调 提交于 2021-01-29 08:22:26
问题 I'm developing a WordPress site for a client who is listing celebrities on her site. Each celebrity profile shows a table of social media stats which is grabbed via the relevant API using the respective user handle. For example the Twitter follower count is retrieved via the Twitter API. Everything works as it should but the page load times are painful. I'm now beginning to think it would make much more sense for the server to make the API queries in the background once a week and update the

How to change linux kernel process priority in programmatic way?

我与影子孤独终老i 提交于 2021-01-29 07:38:39
问题 I found some function 'renice' that changes the nice value of process. But I want to know how to change priority in kernel code . Is it okay that just changing the priority value in sched_entity of process? 回答1: If you want to change the niceness of the process programmatically, I would advise against setting these values in the kernel struct directly. Instead, you can utilize several POSIX functions such as setpriority or pthread_setschedparam . The default scheduler policy on Linux is SCHED