latency

How to ping IP addresses using JavaScript

不想你离开。 提交于 2019-11-27 13:47:38
I want to run a JavaScript code to ping 4 different IP addresses and then retrieve the packet loss and latency of these ping requests and display them on the page. How do I do this? Piskvor You can't do this from JS. What you could do is this: client --AJAX-- yourserver --ICMP ping-- targetservers Make an AJAX request to your server, which will then ping the target servers for you, and return the result in the AJAX result. Possible caveats: this tells you whether the target servers are pingable from your server, not from the user's client so the client won't be able to test hosts its LAN but

Fastest technique to pass messages between processes on Linux?

被刻印的时光 ゝ 提交于 2019-11-27 09:21:47
问题 What is the fastest technology to send messages between C++ application processes, on Linux? I am vaguely aware that the following techniques are on the table: TCP UDP Sockets Pipes Named pipes Memory-mapped files are there any more ways and what is the fastest? 回答1: I would suggest looking at this also: How to use shared memory with Linux in C. Basically, I'd drop network protocols such as TCP and UDP when doing IPC on a single machine. These have packeting overhead and are bound to even

asynchronous IO io_submit latency in Ubuntu Linux

亡梦爱人 提交于 2019-11-27 08:59:27
I am looking for advice on how to get efficient and high performance asynchronous IO working for my application that runs on Ubuntu Linux 14.04. My app processes transactions and creates a file on disk/flash. As the app is progressing through transactions additional blocks are created that must be appended to the file on disk/flash. The app needs also to frequently read blocks of this file as it is processing new transactions. Each transaction might need to read a different block from this file in addition to also creating a new block that has to be appended to this file. There is an incoming

How to prefetch data using a custom python function in tensorflow

廉价感情. 提交于 2019-11-27 06:04:05
I am trying to prefetch training data to hide I/O latency. I would like to write custom Python code that loads data from disk and preprocesses the data (e.g. by adding a context window). In other words, one thread does data preprocessing and the other does training. Is this possible in TensorFlow? Update: I have a working example based on @mrry's example. import numpy as np import tensorflow as tf import threading BATCH_SIZE = 5 TRAINING_ITERS = 4100 feature_input = tf.placeholder(tf.float32, shape=[128]) label_input = tf.placeholder(tf.float32, shape=[128]) q = tf.FIFOQueue(200, [tf.float32,

fastest (low latency) method for Inter Process Communication between Java and C/C++

丶灬走出姿态 提交于 2019-11-27 05:47:01
I have a Java app, connecting through TCP socket to a "server" developed in C/C++. both app & server are running on the same machine, a Solaris box (but we're considering migrating to Linux eventually). type of data exchanged is simple messages (login, login ACK, then client asks for something, server replies). each message is around 300 bytes long. Currently we're using Sockets, and all is OK, however I'm looking for a faster way to exchange data (lower latency), using IPC methods. I've been researching the net and came up with references to the following technologies: shared memory pipes

Is the register keyword still used?

时光毁灭记忆、已成空白 提交于 2019-11-26 23:08:45
问题 Just came across the register keyword in C++ and I wondered as this seems a good idea (keeping certain variables in a register) surely the compiler does this by default? So I wondered is this keyword still used? 回答1: Most implementations just ignore the register keyword (unless it imposes a syntactical or semantical error). The standard also doesn't say that anything must be kept in a register; merely that it's a hint to the implementation that the variable is going to be used very often. Its

Dealing with Latency in Networked Games

╄→尐↘猪︶ㄣ 提交于 2019-11-26 22:33:35
问题 I'm thinking about making a networked game. I'm a little new to this, and have already run into a lot of issues trying to put together a good plan for dead reckoning and network latency, so I'd love to see some good literature on the topic. I'll describe the methods I've considered. Originally, I just sent the player's input to the server, simulated there, and broadcast changes in the game state to all players. This made cheating difficult, but under high latency things were a little

How do I obtain the latency between server and client in C#?

萝らか妹 提交于 2019-11-26 21:38:13
问题 I'm working on a C# Server application for a game engine I'm writing in ActionScript 3. I'm using an authoritative server model as to prevent cheating and ensure fair game. So far, everything works well: When the client begins moving, it tells the server and starts rendering locally; the server, then, tells everyone else that client X has began moving, among with details so they can also begin rendering. When the client stops moving, it tells the server, which performs calculations based on

How do I simulate a low bandwidth, high latency environment?

时间秒杀一切 提交于 2019-11-26 19:14:45
I need to simulate a low bandwidth, high latency connection to a server in order to emulate the conditions of a VPN at a remote site. The bandwidth and latency should be tweakable so I can discover the best combination in order to run our software package. For macOS , there is the Network Link Conditioner that simulates configurable bandwidth, latency, and packet loss. It is contained in the Hardware IO Tools for Xcode . heckj There's an excellent writeup of setting up a FreeBSD machine to do just this - take your standard old desktop, toss in an additional NIC, and build. The writeup is

How to ping IP addresses using JavaScript

扶醉桌前 提交于 2019-11-26 16:18:25
问题 I want to run a JavaScript code to ping 4 different IP addresses and then retrieve the packet loss and latency of these ping requests and display them on the page. How do I do this? 回答1: You can't do this from JS. What you could do is this: client --AJAX-- yourserver --ICMP ping-- targetservers Make an AJAX request to your server, which will then ping the target servers for you, and return the result in the AJAX result. Possible caveats: this tells you whether the target servers are pingable