server

optimise server operations with elasticsearch : addressing low disk watermarks

只愿长相守 提交于 2020-05-17 03:01:34
问题 EDITED - Based on comments of @opster elasticsearch ninja, I edited original question to keep it focused on low disk watermarks error for ES. For more general server optimization on small machine, see: Debugging Elasticsearch and tuning on small server, single node For original follow up on the original question and considerations related to debugging ES failures, also: https://chat.stackoverflow.com/rooms/213776/discussion-between-opster-elasticsearch-ninja-and-user305883 Problem : I noticed

optimise server operations with elasticsearch : addressing low disk watermarks

ⅰ亾dé卋堺 提交于 2020-05-17 03:01:31
问题 EDITED - Based on comments of @opster elasticsearch ninja, I edited original question to keep it focused on low disk watermarks error for ES. For more general server optimization on small machine, see: Debugging Elasticsearch and tuning on small server, single node For original follow up on the original question and considerations related to debugging ES failures, also: https://chat.stackoverflow.com/rooms/213776/discussion-between-opster-elasticsearch-ninja-and-user305883 Problem : I noticed

Debugging Elasticsearch and tuning on small server, single node

冷暖自知 提交于 2020-05-16 03:20:43
问题 I am posting a more general question, after having found I may have more issues than low disk space: optimise server operations with elasticsearch : addressing low disk watermarks and authentication failures My issue is that my ES server crashes occasionally, and cannot figure out why. I want to ensure reliability at least of days, and if error occur, restart the instance automatically. Which best practices could I follow to debug ES on a small server instance, using a single node? This is

Debugging Elasticsearch and tuning on small server, single node

£可爱£侵袭症+ 提交于 2020-05-16 03:20:08
问题 I am posting a more general question, after having found I may have more issues than low disk space: optimise server operations with elasticsearch : addressing low disk watermarks and authentication failures My issue is that my ES server crashes occasionally, and cannot figure out why. I want to ensure reliability at least of days, and if error occur, restart the instance automatically. Which best practices could I follow to debug ES on a small server instance, using a single node? This is

React native upload image to php

∥☆過路亽.° 提交于 2020-05-14 02:24:50
问题 I'm trying to save an image returned from react-native-view-shot which looks something like this (file:///data/user/ReactNative-snapshot-image123.png) but I don't know why the image is not saved on my server. This is what I've done. savePicture = () =>{ this.refs.viewShot.capture().then(uri => { this.setState( { imageURI:uri }); var data = new FormData(); data.append('image', { uri: this.state.imageURI, name: 'my_photo.png', type: 'image/png' }); fetch('http://www.url.com/upload.php', {

React native upload image to php

安稳与你 提交于 2020-05-14 02:24:32
问题 I'm trying to save an image returned from react-native-view-shot which looks something like this (file:///data/user/ReactNative-snapshot-image123.png) but I don't know why the image is not saved on my server. This is what I've done. savePicture = () =>{ this.refs.viewShot.capture().then(uri => { this.setState( { imageURI:uri }); var data = new FormData(); data.append('image', { uri: this.state.imageURI, name: 'my_photo.png', type: 'image/png' }); fetch('http://www.url.com/upload.php', {

“Failed RTM connect” error when trying to connect to Slack with RTM API

允我心安 提交于 2020-05-13 13:41:18
问题 I'm using the following Python code from Slack's "Migrating to 2.x" github docs from slackclient import SlackClient slack_token = os.environ["SLACK_API_TOKEN"] client = SlackClient(slack_token) def say_hello(data): if 'Hello' in data['text']: channel_id = data['channel'] thread_ts = data['ts'] user = data['user'] client.api_call('chat.postMessage', channel=channel_id, text="Hi <@{}>!".format(user), thread_ts=thread_ts ) if client.rtm_connect(): while client.server.connected is True: for data

How to pass templated variables to server-side handler functions in HTML files using Google Apps Script?

时间秒杀一切 提交于 2020-04-30 06:25:26
问题 Follow up to this answer. https://stackoverflow.com/a/60073413/1640892 I want to pass a templated object variable to a server side function in GAS. I expect to see the buttons render, then after filling out the payment details and clicking pay, I expect to see the handleTxn() function successfully execute using the content object as one of its arguments. But, instead, nothing happens because the buttons do not even render. It fails silently. var content = <?!= content ?>; google.script.run

How to pass templated variables to server-side handler functions in HTML files using Google Apps Script?

二次信任 提交于 2020-04-30 06:25:12
问题 Follow up to this answer. https://stackoverflow.com/a/60073413/1640892 I want to pass a templated object variable to a server side function in GAS. I expect to see the buttons render, then after filling out the payment details and clicking pay, I expect to see the handleTxn() function successfully execute using the content object as one of its arguments. But, instead, nothing happens because the buttons do not even render. It fails silently. var content = <?!= content ?>; google.script.run

高性能web服务器的秘密核武器

廉价感情. 提交于 2020-04-28 21:46:09
最近kangle web服务器已经发布了新版2.3.1,其性能比老版本提升8倍之多,静态文件处理能力达apache的8-10倍。如此高的性能怎么来的 呢?kangle有哪些秘密武器呢?其实作为现代化的其它web服务器如nginx,lighttpd,cherokee等其原理都差不多,可能实现细节 有些区别而已。 第一件秘密武器:epoll/IOCP/kqueue新模型 传统的web服务器采用同步socket处理,即每一线程服务于一个客户(apache就是这样),或者是使用传统的select/poll模型。 在连接数小的情况,性能也不会很差,但随着连接数的上升,性能会直线下降,超过一定数量时,会导致服务器无法提供服务。这就是著名的C10K问题。现代化 的web服务器都采用效率更高的模型,linux下面是epoll,windows下面是IOCP,bsd系统的是kqueue. kangle新版也采用这种模型,连接数上升,性能只是会下降一点,基本上很稳定的提供服务。 第二件秘密武器: 非阻塞socket 即使采用了新模型也能更好的处理服务了,但为什么还要非阻塞socket呢?我们知道,对于发送数据(调用send),大多数的情况下是不会阻塞的,因为 数据是直接放到socket的缓冲里面,只有缓冲满了的情况下会阻塞。问题就是我们已经使用了新模型可以检测到该socket能发的时候才发啊?和阻塞有