Hi,
I have a multithreaded script that mainly creates several wget
processes to download files. I would like to check/see and eventually
limit the bandwidth of the pool of processes. One way to do this is to
change the number of wget instances, but it's a workaround.
What do you recommend to do the following in python:
1) know the bitrate at the script scale
2) control, and limit or not this bitrate
Thanks,
Mathieu 3 1581
I have a multithreaded script that mainly creates several wget
processes to download files. I would like to check/see and eventually
limit the bandwidth of the pool of processes. One way to do this is to
change the number of wget instances, but it's a workaround.
What do you recommend to do the following in python:
1) know the bitrate at the script scale
2) control, and limit or not this bitrate
I recommend to not use wget, but implement the network access directly
in Python. Then you can easily measure that bitrate, and also limit it.
(by having some threads sleep).
Once you fork out new processes, you lose, unless there is an operating
system bandwidth limitation framework available which works on groups
of processes. Solaris project objects may provide such a thing, but
apart from that, I don't think it's available in any operating system
that you might be using.
Regards,
Martin
I have a multithreaded script that mainly creates several wget
processes to download files. I would like to check/see and eventually
limit the bandwidth of the pool of processes. One way to do this is to
change the number of wget instances, but it's a workaround.
What do you recommend to do the following in python:
1) know the bitrate at the script scale
2) control, and limit or not this bitrate
I recommend to not use wget, but implement the network access directly
in Python. Then you can easily measure that bitrate, and also limit it.
(by having some threads sleep).
Once you fork out new processes, you lose, unless there is an operating
system bandwidth limitation framework available which works on groups
of processes. Solaris project objects may provide such a thing, but
apart from that, I don't think it's available in any operating system
that you might be using.
Regards,
Martin
Mathieu Prevot schrieb:
Hi,
I have a multithreaded script that mainly creates several wget
processes to download files. I would like to check/see and eventually
limit the bandwidth of the pool of processes. One way to do this is to
change the number of wget instances, but it's a workaround.
What do you recommend to do the following in python:
1) know the bitrate at the script scale
2) control, and limit or not this bitrate
I'm not aware that python can do that. But under Linux you might
consider using trickled.
Diez This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nicolas C. |
last post by:
Hello,
I'd like to make some download speed limitation on some of my files
using PHP. I know that an Apache module can do that, but i cannot access
my ISP Apache configuration.
My idea was to put the file into a .htaccess protected diretory and to
build a "proxy" with PHP.
I can also put a download limit (after n download per day the script
|
by: Nicolas C. |
last post by:
Hello,
I'd like to make some download speed limitation on some of my files
using PHP. I know that an Apache module can do that, but i cannot access
my ISP Apache configuration.
My idea was to put the file into a .htaccess protected diretory and to
build a "proxy" with PHP.
I can also put a download limit (after n download per day the script
|
by: Marin |
last post by:
Hello,
I'm using:
Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4
MySQL 4.1.12
DocMan1.3RC1 (PHP based document manager)
I'm having following problem: file uploads OK, but problem occurs when I try to download or view the file.
After some innvestigation, I found out that only first 2MB od data is actually downloaded (exactly 2.000.000
bytes) resulting in corrupted files. (uploaded files are OK!)
I couldn't find that limit...
|
by: tjfdownsouth |
last post by:
I have a site that allows a person to log in and get a list of files to
download for them. If the file size is under 65MB then everything is fine,
they click the download button and the save box pops up. But if the file is
larger than 65MB the page sits and processes until it times out. I can't
figure it out becaus a 64MB file loads immediately for download while one
slightly larger hangs up.
Any assistance on this will be greatly...
|
by: bigpoppa |
last post by:
Hey, I need a script that will limit download speed and I want it integrated into the script I am using below. The script below forces downloads and hides url paths and logs stastics of downloads and displays them. I want to make it so if I import this script using the include header that it will also limit the download speed for files on my site to 20kbps. I don't want to have to include any fancy stuff in the <a href> tag. I have attached the...
| |
by: comp.lang.php |
last post by:
index.php:
// STUFF
// STEP 1: imagecreatetruecolor ONLY IF GD 2.0+ SUPPORTED AND FOUND
if ($this->isSuccessful && !$hasMogrified && $image && !$newImage &&
function_exists('imagecreatetruecolor') && preg_match('/2\.0/i',
$this->gd_info_array)) {
$newImage = @imagecreatetruecolor($configArray,
$configArray);
|
by: Katie |
last post by:
Hi,
I am downloading files using ASP using the the binarywrite as below.
objStream.LoadFromFile(strAbsFile)
'-- send the stream in the response
Response.BinaryWrite(objStream.Read)
I was wondering is there any way I can control or throttle the
download?. I want to make sure that the users are not taking up too
|
by: Bob Bedford |
last post by:
I've to build a website where the customer can buy an image. I'm thinking in
the 2 ways to let people get those images: receive them by Email or send
them an image link wich validity is limited in time.
The second may help me to know if an image has been downloaded and how many
times.
How to build such download link ?
The informations I'd like is the userid, the datetime limit and the
imagefile, off course everything must be encrypted...
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |